pandas 使用

  1. import pandas as pd
    a = [3,7,2]
    myvar = pd.Series(a,index=["x","y","z"])
    print(myvar["x"]) #结果是3  #给序列赋值index ,然后可以根据index找到对应的数 
  2. data = {"col1": range(-5,0), "col2": range(5)}
    cdf = pd.DataFrame(data)
    print(cdf)  
      
    print(cdf.loc[2])  #取第三行的值
     

     

  3.  clear data 

    pandas 使用_第1张图片

  corr() method is a table with a lot of numbers that represents how well the relationship is between two columns.

import matplotlib.pyplot as plt                              

 df.plot() #图标
plt.show()

pandas 更多用法参考一下:

 Pandas - DataFrame Reference

你可能感兴趣的:(test,skills,pandas,python,开发语言)