Data Visualization (2): Data Visualization

Source: Internet
Author: User

Data Visualization (2): Data Visualization

Source: https://www.dataquest.io/mission/132/data-visualization-and-exploration

Data Source https://github.com/fivethirtyeight/data/blob/master/college-majors/recent-grads.csv

This article describes how to easily explore the relationship between data.

 

Raw data presentation (this is a salary survey report for college graduates. The important fields include Major-Major name, Major_category-Major category, Sample_size-sample size, and ShareWomen-female proportion, total-Total number of professionals)

import pandas as pdrecent_grads = pd.read_csv('recent-grads.csv')

# Create a histogram recent_grads.hist ('mediance') for the Median of wage income ')

# The hist () function is automatically divided into 10 equal points by default, and the generated graph has gridlines. Now it is divided into 20 equal points, and the grid lines recent_grads.hist ('media ', bins = 20, grid = False)

# In fact, multiple histograms can be created at a time. The layout parameter means to divide two graphs into two rows and one column. If this parameter is not specified, by default, all graphs are placed in the same row columns = ['mediance', 'sample _ size'] recent_grads.hist (column = columns, layout = (), grid = False)

Import matplotlib. pyplot as plt # select two columns of Data sample_size = recent_grads [['sample _ size ', 'Major _ category '] # Calculate sample_size.boxplot (by = 'major _ category') by category of each Major type # rotate the coordinate text on the X axis 90 degrees and vertically display the plt. xticks (rotation = 90)

# Put the two scatter plots together (by color) and check whether there is any association with import matplotlib. pyplot as pltplt. scatter (recent_grads ['mpmployment _ rate'], recent_grads ['media'], color = 'red') plt. scatter (recent_grads ['mongowomen'], recent_grads ['media'], color = 'blue') plt. show ()

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.