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

Data Visualizations 1

时间:2016-10-13 07:44:09      阅读:116      评论:0      收藏:0      [点我收藏+]

标签:

1.Independent variables : each variable is saperate from others in the dataset.

2.Data scatter:

weight = [600,150,200,300,200,100,125,180] 
height = [60,65,73,70,65,58,66,67] # dataset

import matplotlib.pyplot as plt # import pyplot from matplotlib 
plt.scatter(height, weight) # scatter(x,y)
plt.show() #show the plot

3. Scatter function can scatter both list and Series format

4. Line chart is similar to scatter.

5. Use Range() function to replace .index. Because Range() can also generate a list of numbers .

6. How to plot two data sets in the Dataframe :

  a. Convert two data (y column) into a Series by using pivot.table. Example:area_by_month = forest_fires.pivot_table(index="month", values="area", aggfunc=numpy.mean)

  b. Plot the Series into the format we need to show by using .index or range(len()) function.

7. Use plt.style.use("ggplot") to change the style of the plot.

 

Data Visualizations 1

标签:

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

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