Current location - Training Enrollment Network - Books and materials - How to write the visual code of Dangdang book sales?
How to write the visual code of Dangdang book sales?
1, based on Python and Matplotlib libraries, suppose Dangdang book sales data is saved in a CSV file named dangdang_sales.csv', which contains two fields: book classification and sales.

2. First, read the data into the DataFrame object using Pandas library, and then use the groupby method to count the sales by category, and sort the sales from high to low. Finally, draw a bar graph with Matplotlib library and set the angle of title, label and X-axis label.