码迷,mamicode.com
首页 > 其他好文 > 详细

Data Visualizations 2

时间:2016-10-14 06:56:27      阅读:172      评论:0      收藏:0      [点我收藏+]

标签:

1.Histogram :

A histogram is a graph that enables you to visualize the distribution of values of a column.

Example: 

  import matplotlib.pyplot as plt

  columns = [‘Median‘,‘Sample_size‘]
  recent_grads.hist(column=columns)# to visulize the column "Median" and "Sample_size" and present them into two different charts.

2. The box plot: another way to represent a set of data. 

  sample_size = recent_grads[[‘Sample_size‘, ‘Major_category‘]] #sample_size is a filtered DataFrame which only contain two columns "Sample_size" and "Major_category"

  sample_size.boxplot(by=‘Major_category‘)# In the filtered DataFrame. We are going to categorize the data by using column "Major_category"

  plt.xticks(rotation=90)

SeaBorn:

1. Compare to Matplotlib, SeaBorn can create more compelling chart which is in a better style.

 

Data Visualizations 2

标签:

原文地址:http://www.cnblogs.com/kingoscar/p/5958731.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!