Created
January 12, 2017 14:39
-
-
Save gidden/7d015aceb369c426ff7d5d64d88ec9d6 to your computer and use it in GitHub Desktop.
columns in dataframe with numeric types
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
def numcols(df): | |
"""Returns columns in dataframe with numeric types""" | |
dtypes = df.dtypes | |
return [i for i in dtypes.index if dtypes.loc[i].name.startswith(('float', 'int'))] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment