1.read_excel('路徑.xls',names=["a","b"])
2.to_excel('路徑.xls',header=False,index=False)
3.dropna()過濾缺失數據
如果是Series,則返回一個僅含非空數據和索引值的Series,默認丟棄含有缺失值的行。
df.dropna(how = 'all') # 傳入這個參數後將只丟棄全爲缺失值的那些行
df.dropna(axis = 1) # 丟棄有缺失值的列(一般不會這麼做,這樣會刪掉一個特徵)
df.dropna(axis=1,how="all") # 丟棄全爲缺失值的那些列
df.dropna(axis=0,how="all") # 丟棄全爲缺失值的那些行
df.dropna(axis=0,subset = ["Age", "Sex"]) # 丟棄‘Age’和‘Sex’這兩列中有缺失值的行
4.pd.DataFrame()
5.df.loc
6.df.iloc