Skip to content

Instantly share code, notes, and snippets.

View rocarvaj's full-sized avatar
🐀

Rodolfo Carvajal rocarvaj

🐀
View GitHub Profile
@rocarvaj
rocarvaj / useful_pandas_snippets.py
Last active August 3, 2016 20:07 — forked from bsweger/useful_pandas_snippets.md
Useful Pandas Snippets
# Merging a pandas groupby result back into DataFrame
# Ref: http://stackoverflow.com/a/29642002/162264
df['maxval'] = df.groupby(by=['idn']).transform('max')
#Print full dataframe
def print_full(x):
pd.set_option('display.max_rows', len(x))
print(x)
pd.reset_option('display.max_rows')