display options #
https://towardsdatascience.com/6-pandas-display-options-you-should-memories-84adf8887bc3
pandas autodetects the size of your terminal window if you set
pd.options.display.width = 0
pd.set_option('display.max_rows', 2500)
pd.set_option('display.max_columns', 1000)
pd.set_option('display.width', 2000)
just panda things #
pandas 一些出人意料的地方,以及对性能有帮助的小tips。
[TODO]fast pandas #
benchmark pandas
pandas write to excel, with sheets #
pd.ExcelWriter
可以用不同的engine,比如 openpyxl。
with pd.ExcelWriter('hello.xlsx') as writer:
df1.to_excel(writer, sheet_name='df1')
df2.to_excel(writer, sheet_name='df2')
写入的时候datetime不能是aware timezone的,可以:
my_series.dt.tz_localize(None)