Last active
August 29, 2015 14:25
-
-
Save masnick/378d39a92191db263fd2 to your computer and use it in GitHub Desktop.
IPython notebook snipped for a list of variables in a dataframe
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Assumes `df` is a Pandas DataFrame object | |
import IPython.core.display as di | |
for k, v in df.columns.to_series().groupby(df.dtypes).groups.iteritems(): | |
di.display_html("<ul><li><b>%s</b><ul>%s</ul></li></ul>" % (k, ''.join(["<li>%s</li>" % vv for vv in sorted(v)])), raw=True) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment