Python+pandas+matplotlib data analysis and visualization cases

Source: Internet
Author: User

Problem Description: Run the following program to generate the hotel turnover simulation data file in the current folder Data.csv

Then complete the following tasks:

1) Use Pandas to read the data in the file Data.csv, create the Dataframe object, and delete all of the missing values;

2) Use Matplotlib to generate line chart, reflect the daily turnover of the hotel, and save the graphic as a local file first.jpg;

3) Statistics by month, using Matplotlib to draw a histogram showing the turnover of each month, and save the graphic as a local file second.jpg;

4) According to the month statistics, find the next two months maximum increase, and the largest increase in the month to write file maxMonth.txt;

5) Quarterly statistics of the hotel's turnover in 2018, using Matplotlib to generate a pie chart showing the distribution of turnover in the 4 quarters of 2018 years, and save the graphic as a local file third.jpg.

Problem resolution Reference Code:

The resulting first.jpg effect:

The resulting second.jpg effect:

The resulting third.jpg effect:

Python+pandas+matplotlib data analysis and visualization cases

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.