{"metadata":{"kernelspec":{"language":"python","display_name":"Python 3","name":"python3"},"language_info":{"pygments_lexer":"ipython3","nbconvert_exporter":"python","version":"3.6.4","file_extension":".py","codemirror_mode":{"name":"ipython","version":3},"name":"python","mimetype":"text/x-python"}},"nbformat_minor":4,"nbformat":4,"cells":[{"cell_type":"code","source":"import numpy as np # linear algebra\nimport pandas as pd # data processing, CSV file I/O (e.g. pd.read_csv)\nimport os\nimport datatable as dt","metadata":{},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"def rm(df):\n    for col in df.columns:\n        col_type = df[col].dtype    \n        if col_type == '<M8[ns]':\n            continue\n        if (col_type != object) and (type(col_type) != pd.core.dtypes.dtypes.CategoricalDtype):\n            c_min = df[col].min()\n            c_max = df[col].max()\n            if str(col_type)[:3] == 'int':\n                if c_min > np.iinfo(np.int8).min and c_max < np.iinfo(np.int8).max:\n                    df[col] = df[col].astype(np.int8)\n                elif c_min > np.iinfo(np.int16).min and c_max < np.iinfo(np.int16).max:\n                    df[col] = df[col].astype(np.int16)\n                elif c_min > np.iinfo(np.int32).min and c_max < np.iinfo(np.int32).max:\n                    df[col] = df[col].astype(np.int32)\n                elif c_min > np.iinfo(np.int64).min and c_max < np.iinfo(np.int64).max:\n                    df[col] = df[col].astype(np.int64)  \n            else:\n                if c_min > np.finfo(np.float16).min and c_max < np.finfo(np.float16).max:\n                    df[col] = df[col].astype(np.float16)\n                elif c_min > np.finfo(np.float32).min and c_max < np.finfo(np.float32).max:\n                    df[col] = df[col].astype(np.float32)\n                else:\n                    df[col] = df[col].astype(np.float64)\n        else:\n            df[col] = df[col].astype('category')                    \n    return df","metadata":{},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"td = dt.fread('../input/nfl-big-data-bowl-2022/tracking2018.csv')\nt1 = rm(td.to_pandas())\ndel td\ntd = dt.fread('../input/nfl-big-data-bowl-2022/tracking2019.csv')\nt2 = rm(td.to_pandas())\ndel td\ntd = dt.fread('../input/nfl-big-data-bowl-2022/tracking2020.csv')\nt3 = rm(td.to_pandas())\ndel td","metadata":{"execution":{"iopub.status.busy":"2021-11-11T22:13:41.953155Z","iopub.execute_input":"2021-11-11T22:13:41.953538Z","iopub.status.idle":"2021-11-11T22:14:15.094018Z","shell.execute_reply.started":"2021-11-11T22:13:41.953501Z","shell.execute_reply":"2021-11-11T22:14:15.092653Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"tracking = pd.concat([t1,t2,t3])\ndel t1,t2, t3","metadata":{"execution":{"iopub.status.busy":"2021-11-11T22:28:49.755345Z","iopub.execute_input":"2021-11-11T22:28:49.755757Z","iopub.status.idle":"2021-11-11T22:28:54.614785Z","shell.execute_reply.started":"2021-11-11T22:28:49.755719Z","shell.execute_reply":"2021-11-11T22:28:54.613933Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"# tracking.to_csv('tracking2018-2020.csv', index = False)","metadata":{"execution":{"iopub.status.busy":"2021-11-11T22:32:33.022987Z","iopub.execute_input":"2021-11-11T22:32:33.023716Z","iopub.status.idle":"2021-11-11T22:42:07.017964Z","shell.execute_reply.started":"2021-11-11T22:32:33.023666Z","shell.execute_reply":"2021-11-11T22:42:07.016846Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"!pip install xlrd\n!pip install autoviz\nfrom autoviz.AutoViz_Class import AutoViz_Class","metadata":{"execution":{"iopub.status.busy":"2021-11-11T22:20:30.182239Z","iopub.execute_input":"2021-11-11T22:20:30.183009Z","iopub.status.idle":"2021-11-11T22:20:57.795849Z","shell.execute_reply.started":"2021-11-11T22:20:30.18296Z","shell.execute_reply":"2021-11-11T22:20:57.794894Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"tracking","metadata":{"execution":{"iopub.status.busy":"2021-11-11T22:43:17.796282Z","iopub.execute_input":"2021-11-11T22:43:17.7967Z","iopub.status.idle":"2021-11-11T22:43:17.85599Z","shell.execute_reply.started":"2021-11-11T22:43:17.796657Z","shell.execute_reply":"2021-11-11T22:43:17.855106Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"AV = AutoViz_Class()\ndf = AV.AutoViz(filename=\"\", sep=',', dfte = tracking, header=0, verbose=1, lowess= False, \n                chart_format='svg',  max_cols_analyzed = 15)","metadata":{"execution":{"iopub.status.busy":"2021-11-11T22:44:08.272173Z","iopub.execute_input":"2021-11-11T22:44:08.272536Z","iopub.status.idle":"2021-11-11T22:47:07.646434Z","shell.execute_reply.started":"2021-11-11T22:44:08.272493Z","shell.execute_reply":"2021-11-11T22:47:07.645499Z"},"trusted":true},"execution_count":null,"outputs":[]}]}