1.the dataframe consist of an ordered collection of columns,each of which can contaion a value of a different type.
2.define:字典形式(键是column)pd.DataFrame({‘A’:【a,b,c,d,】,'B':【e,f,g,h】})
选择一部分column作为dataframe:pd.DataFrame(data,columns=【‘A','B’】)#选择data数据的AB两列作为dataframe数据。
给行标签(默认总0开始的数字):pd.DataFrame(data,index=['one','two','three']
generate:pd.DataFrame(np.arange(16).reshape((4,4)),index=['red','blue','yellow','white'],columns=['ball','pen'.'pencil','paper']
3.to know the colunms:frame.columns
to know the index:frame.index
to know the data:frame.values
4.selecting only a column(series类型):frame【‘price’】 or frame.price
5.selecting only a row(series类型):frame.loc[2]#取第二行
selecting multiple rows :frame.loc[[2,4]]#取第二行和第四行
extract a portion (sequence rows): frame[1:3]#取第一行到第是三行之前
selecting a single value:frame【'column标签值‘(列数)】[行数]
6.