Pandas
Cheat Sheet
Display
pd.get_option('display.max_rows') pd.get_option('display.max_columns') pd.set_option('display.max_rows', None) pd.set_option('display.max_columns', None)
I/O
df = pd.read_csv('sample.csv')
Misc
df.replace({'n':0, 'y':1}) df[df['a'] == 'y'].sort_values(by='b') df[(df['a'] == 'y') & (df['b'].notnull())].sort_values(by='c') df.loc[df['a'] == 0, ['b']] = 1 df['a'].notnull() * 1
References
Acknowledgments
Daiphys is a professional-service company for research and development of leading-edge technologies in physics and engineering.
Get started accelerating your business through our deep expertise in R&D with AI, quantum computing, and space development; please get in touch with Daiphys today!
Daiphys Technologies LLC - https://www.daiphys.com/