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. The use of line chart is similar to scatter.

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

  for i in range(0#start, -10#stop, -2#step):

   print(i)
Output:
    0
    -2
    -4
    -6  
    -8

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.

 

posted on 2016-10-13 04:45  阿难1020  阅读(136)  评论(0编辑  收藏  举报