Created
September 14, 2020 02:08
-
-
Save deanjamesss/1036452026126cc7441690a4a2efe011 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
| import pandas as pd | |
| if __name__ == '__main__': | |
| # Override default pandas configuration | |
| pd.options.display.width = 0 | |
| pd.options.display.max_rows = 10000 | |
| pd.options.display.max_info_columns = 10000 | |
| # Open example data. | |
| df = pd.read_csv('employee_data.csv') | |
| # Cast types to save memory. | |
| df['gender'] = df['gender'].astype('category') | |
| df['employment_status'] = df['employment_status'].astype('category') | |
| df['birth_date'] = df['birth_date'].astype('datetime64') | |
| # Rename columns | |
| df.rename(columns={'number': 'staff_id'}, inplace=True) | |
| print(df.info()) | |
| print(df.describe(include='all', datetime_is_numeric=True)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment