Created
January 11, 2019 13:28
-
-
Save admond1994/1fdfa6bf6e6c1899044683508c768468 to your computer and use it in GitHub Desktop.
This file contains hidden or 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 change_dtypes(col_int, col_float, df): | |
| ''' | |
| AIM -> Changing dtypes to save memory | |
| INPUT -> List of column names (int, float), df | |
| OUTPUT -> updated df with smaller memory | |
| ------ | |
| ''' | |
| df[col_int] = df[col_int].astype('int32') | |
| df[col_float] = df[col_float].astype('float32') |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment