import os
import numpy as np
import pandas as pd
from pandas import Series, DataFrame
# 输出窗口能够输出所有的列而不换行显示
pd.set_option('display.expand_frame_repr',False)
pd.set_option('display.max_columns', None)
# 使用字典创建DataFrame
# 字典名 = {
# '列索引' : [该列的所有值],
# .
# .
# .
# '列索引' : [该列的所有值]
# }
# df=DataFrame(data=dic, index=[]), 无须另写columns 需要写index
# 以经纬度,海面风速等作为列
dic = {
'latitude':[1,2,3],
'longitude':[1,2,3],
'time':[1,2,3],
'WIND_surface':[1,2,3],
'WDIR_surface':[1,2,3],
'UGRD_surface':[1,2,3],
'VGRD_surface':[1,2,3],
'ICEC_surface':[1,2,3]
# 'HTSGW_surface':[1,2,3],
# 'IMWF_surface':[1,2,3],
# 'MWSPER_surface':[1,2,3],
# 'PERPW_surface':[1,2,3],
# 'WWSDIR_surface':[1,2,3],
# 'DIRPW_surface':[1,2,3],
# 'WVHGT_surface':[1,2,3],
# 'SWELL_1insequence':[1,2,3],
# 'SWELL_2insequence':[1,2,3],
# 'SWELL_3insequence':[1,2,3],
# 'WVPER_surface':[1,2,3],
# 'SWPER_1insequence':[1,2,3],
# 'SWPER_2insequence':[1,2,3],
# 'SWPER_3insequence':[1,2,3],
# 'WVDIR_surface':[1,2,3],
# 'SWDIR_1insequence':[1,2,3],
# 'SWDIR_2insequence':[1,2,3],
# 'SWDIR_3insequence':[1,2,3]
}
df=DataFrame(data=dic,index=['r1','r2','r3'])
# print(df['r1':'r2', 'latitude':'time'])