DataFrame

Pandasの基本になる複数の変数をまとめるオブジェクトを作る関数.与えるデータは辞書で与えるのがお勧め.
使用例
import pandas as pdimport numpy as npyears=np.arange(1980,2020+1)x=np.random.randn(len(years)) # x というデータを生成y=np.random.randn(len(years)) # y というデータを生成df = pd.DataFrame({'year':years,'x':x,'y':y})print(df)
結果は year x y0 1980 1.670936 0.1572351 1981  -0.289255 -0.2645842 1982 1.553727 - 1.253405....のようになる.
This function creates an an object called dataframe that summarizes multiple variables. I found that input data of a dictionary is the best way in many cases.
Example of use
import pandas as pdimport numpy as npyears=np.arange(1980,2020+1)x=np.random.randn(len(years)) # generate data name of xy=np.random.randn(len(years)) # generate data name of ydf = pd.DataFrame({'year':years,'x':x,'y':y})print(df)
The results are year x y0 1980 1.670936 0.1572351 1981  -0.289255 -0.2645842 1982 1.553727 - 1.253405....