|
pd.read_excel(path, sheet_name='Sheet2', encoding='utf-16')
|
|
df_excel = pd.ExcelFile(path)
|
|
sheets = df_excel.sheet_names
|
|
df_aba = df_excel.parse(<nome da aba>, skiprows=[1,2], header=None)
|
|
pd.read_csv(path, sep=' ', header=None)
|
|
my_dict = {'Computer':1500,'Monitor':300}
|
|
|
df = pd.DataFrame(list(my_dict.items()),columns = ['Products','Prices'])
|
|
For i, row in df.iterrows():
|
|
print(row)
|
|
row = row.replace({np.nan: None})
|
|
pd[pd[2].isna()]
|
|
dt_inicial = pd.Timestamp(2020, 1, 30)
|
|
|
dt_final = pd.Timestamp(2020, 1, 31)
|
|
|
df.loc[str(dt_inicial):str(dt_final)]
|
|
|
OR
|
|
|
df.loc['2002-1-1 01:00:00':'2002-1-1 04:00:00']
|
|
diff = df1[~df1.astype(str).apply(tuple, 1).isin(df2.astype(str).apply(tuple, 1))]
|
|
df.append(pd.Series(name='new row'))
|
|
df['new column'] = np.nan
|
|
df[2].map({'yes':1, 'no':0})
|
|
pd.to_datetime(df[3], format="%Y%m%d%H")
|
|
df.iloc[:,4].str.replace('.', '').str.replace(',', '.').astype(float, inplace=True)
|
|
df[3].dt.date
|
|
df.astype(int)
|
|
f.drop([0, 1, 5], inplace=True)
|
|
df.drop([2, 5'], axis=1)
|
|
pd.Series(df[1].values, index=df[0]).to_dict()
|
|
df.to_csv('file_out.csv', sep='\t', index=False, encoding='utf-8-sig')
|
No comments yet.
Cheatography n. The art of mapping complex subjects into clear, instantly navigable reference guides.