{"metadata":{"kernelspec":{"language":"python","display_name":"Python 3","name":"python3"},"language_info":{"name":"python","version":"3.10.14","mimetype":"text/x-python","codemirror_mode":{"name":"ipython","version":3},"pygments_lexer":"ipython3","nbconvert_exporter":"python","file_extension":".py"},"kaggle":{"accelerator":"none","dataSources":[{"sourceId":81933,"databundleVersionId":9643020,"sourceType":"competition"}],"dockerImageVersionId":30786,"isInternetEnabled":true,"language":"python","sourceType":"notebook","isGpuEnabled":false}},"nbformat_minor":4,"nbformat":4,"cells":[{"cell_type":"code","source":"# This Python 3 environment comes with many helpful analytics libraries installed\n# It is defined by the kaggle/python Docker image: https://github.com/kaggle/docker-python\n# For example, here's several helpful packages to load\n\nimport numpy as np # linear algebra\nimport pandas as pd # data processing, CSV file I/O (e.g. pd.read_csv)\nimport matplotlib.pyplot as plt\nimport numpy as np\nimport seaborn as sns\n\n# Input data files are available in the read-only \"../input/\" directory\n# For example, running this (by clicking run or pressing Shift+Enter) will list all files under the input directory\n\nimport os\nfor dirname, _, filenames in os.walk('/kaggle/input'):\n    for filename in filenames:\n        print(os.path.join(dirname, filename))\n\n# You can write up to 20GB to the current directory (/kaggle/working/) that gets preserved as output when you create a version using \"Save & Run All\" \n# You can also write temporary files to /kaggle/temp/, but they won't be saved outside of the current session","metadata":{"_uuid":"8f2839f25d086af736a60e9eeb907d3b93b6e0e5","_cell_guid":"b1076dfc-b9ad-4769-8c92-a6c4dae69d19","execution":{"iopub.status.busy":"2024-11-12T03:50:22.198550Z","iopub.execute_input":"2024-11-12T03:50:22.199020Z","iopub.status.idle":"2024-11-12T03:50:28.150109Z","shell.execute_reply.started":"2024-11-12T03:50:22.198979Z","shell.execute_reply":"2024-11-12T03:50:28.148881Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"df = pd.read_csv(\"/kaggle/input/child-mind-institute-problematic-internet-use/data_dictionary.csv\")\ndf.head()","metadata":{"execution":{"iopub.status.busy":"2024-11-11T10:22:41.938056Z","iopub.execute_input":"2024-11-11T10:22:41.938537Z","iopub.status.idle":"2024-11-11T10:22:41.961049Z","shell.execute_reply.started":"2024-11-11T10:22:41.938500Z","shell.execute_reply":"2024-11-11T10:22:41.959861Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"df.shape","metadata":{"execution":{"iopub.status.busy":"2024-11-06T08:36:25.505360Z","iopub.execute_input":"2024-11-06T08:36:25.505801Z","iopub.status.idle":"2024-11-06T08:36:25.512851Z","shell.execute_reply.started":"2024-11-06T08:36:25.505744Z","shell.execute_reply":"2024-11-06T08:36:25.511704Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":"# Value Counts, unique and no. of unique of Instruments","metadata":{}},{"cell_type":"code","source":"vCOfI = df[\"Instrument\"].value_counts()\nuOfI = df[\"Instrument\"].unique()\nunOfI = df[\"Instrument\"].nunique()\nprint(vCOfI)\nprint(uOfI)\nprint(unOfI)\n","metadata":{"execution":{"iopub.status.busy":"2024-11-06T08:36:30.204724Z","iopub.execute_input":"2024-11-06T08:36:30.205173Z","iopub.status.idle":"2024-11-06T08:36:30.221425Z","shell.execute_reply.started":"2024-11-06T08:36:30.205132Z","shell.execute_reply":"2024-11-06T08:36:30.220251Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":"# Value count, unique and no. of unique of field","metadata":{}},{"cell_type":"code","source":"vCOfF = df[\"Field\"].value_counts()\nprint(vCOfF)\nnofUV = df[\"Field\"].unique()\nprint(nofUV)\nnofUV = df[\"Field\"].nunique()\nprint(nofUV)","metadata":{"execution":{"iopub.status.busy":"2024-11-06T08:36:38.509582Z","iopub.execute_input":"2024-11-06T08:36:38.510505Z","iopub.status.idle":"2024-11-06T08:36:38.520409Z","shell.execute_reply.started":"2024-11-06T08:36:38.510456Z","shell.execute_reply":"2024-11-06T08:36:38.518923Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":" 81 rows and 81 values so no same value in field column","metadata":{}},{"cell_type":"markdown","source":"# What are the values of  column filed have last value sesson in label column","metadata":{}},{"cell_type":"code","source":"for i in range(len(df[\"Field\"])):\n    if df[\"Field\"].iloc[i].endswith(\"Season\"):\n        print(str(i) + \" \"+df[\"Values\"].iloc[i])","metadata":{"execution":{"iopub.status.busy":"2024-11-06T05:16:15.272316Z","iopub.execute_input":"2024-11-06T05:16:15.272995Z","iopub.status.idle":"2024-11-06T05:16:15.283740Z","shell.execute_reply.started":"2024-11-06T05:16:15.272919Z","shell.execute_reply":"2024-11-06T05:16:15.282033Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":"So we conculde that all use in four sessaon","metadata":{}},{"cell_type":"markdown","source":"# What are the values ends with age of field column","metadata":{}},{"cell_type":"code","source":"for i in range(len(df[\"Field\"])):\n    if df[\"Field\"].iloc[i].endswith(\"Age\"):\n        print(str(i) + \" \"+str(df[\"Values\"].iloc[i]))","metadata":{"execution":{"iopub.status.busy":"2024-11-06T08:36:53.853829Z","iopub.execute_input":"2024-11-06T08:36:53.854253Z","iopub.status.idle":"2024-11-06T08:36:53.863110Z","shell.execute_reply.started":"2024-11-06T08:36:53.854212Z","shell.execute_reply":"2024-11-06T08:36:53.861796Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":"# What are the all field name of Children's Global Assessment Scale of instrument column","metadata":{}},{"cell_type":"code","source":"for i in range(len(df[\"Field\"])):\n    if df[\"Instrument\"].iloc[i] == \"Children's Global Assessment Scale\":\n        print(str(i) + \" \" + df[\"Field\"].iloc[i])","metadata":{"execution":{"iopub.status.busy":"2024-11-06T08:36:59.428318Z","iopub.execute_input":"2024-11-06T08:36:59.428711Z","iopub.status.idle":"2024-11-06T08:36:59.437087Z","shell.execute_reply.started":"2024-11-06T08:36:59.428675Z","shell.execute_reply":"2024-11-06T08:36:59.436019Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":"Age factor is only given in demographic\n","metadata":{}},{"cell_type":"markdown","source":"# What is the description of Instrument column which has value Demographic ","metadata":{}},{"cell_type":"code","source":"for i in range(len(df[\"Field\"])):\n    if df[\"Instrument\"].iloc[i] == \"Demographics\":\n        print(df[\"Description\"].iloc[i])","metadata":{"execution":{"iopub.status.busy":"2024-11-06T08:42:53.543372Z","iopub.execute_input":"2024-11-06T08:42:53.543842Z","iopub.status.idle":"2024-11-06T08:42:53.553169Z","shell.execute_reply.started":"2024-11-06T08:42:53.543792Z","shell.execute_reply":"2024-11-06T08:42:53.551646Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"dfTest = pd.read_csv(\"/kaggle/input/child-mind-institute-problematic-internet-use/test.csv\")\ndfTest.head()","metadata":{"execution":{"iopub.status.busy":"2024-11-06T08:44:42.042347Z","iopub.execute_input":"2024-11-06T08:44:42.042823Z","iopub.status.idle":"2024-11-06T08:44:42.090237Z","shell.execute_reply.started":"2024-11-06T08:44:42.042751Z","shell.execute_reply":"2024-11-06T08:44:42.088938Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"dfTest.shape","metadata":{"execution":{"iopub.status.busy":"2024-11-06T08:45:39.129390Z","iopub.execute_input":"2024-11-06T08:45:39.129830Z","iopub.status.idle":"2024-11-06T08:45:39.137024Z","shell.execute_reply.started":"2024-11-06T08:45:39.129791Z","shell.execute_reply":"2024-11-06T08:45:39.135809Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"dfTrain = pd.read_csv(\"/kaggle/input/child-mind-institute-problematic-internet-use/train.csv\")\ndfTrain.head()","metadata":{"execution":{"iopub.status.busy":"2024-11-12T03:50:55.570159Z","iopub.execute_input":"2024-11-12T03:50:55.570893Z","iopub.status.idle":"2024-11-12T03:50:55.711773Z","shell.execute_reply.started":"2024-11-12T03:50:55.570841Z","shell.execute_reply":"2024-11-12T03:50:55.710385Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"dfTrain.shape","metadata":{"execution":{"iopub.status.busy":"2024-11-06T08:47:13.646929Z","iopub.execute_input":"2024-11-06T08:47:13.647986Z","iopub.status.idle":"2024-11-06T08:47:13.655024Z","shell.execute_reply.started":"2024-11-06T08:47:13.647936Z","shell.execute_reply":"2024-11-06T08:47:13.653826Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":"# Value count of Basic_Demos-Enrol_Season, unique and nunique value of this","metadata":{}},{"cell_type":"code","source":"vCOfBDES = dfTrain[\"Basic_Demos-Enroll_Season\"].value_counts()\nprint(vCOfBDES)\nuVOfBDES = dfTrain[\"Basic_Demos-Enroll_Season\"].unique()\nprint(uVOfBDES)\nnOfuVOfBDES = dfTrain[\"Basic_Demos-Enroll_Season\"].nunique()\nprint(nOfuVOfBDES)","metadata":{"execution":{"iopub.status.busy":"2024-11-06T08:54:14.404886Z","iopub.execute_input":"2024-11-06T08:54:14.405327Z","iopub.status.idle":"2024-11-06T08:54:14.416716Z","shell.execute_reply.started":"2024-11-06T08:54:14.405284Z","shell.execute_reply":"2024-11-06T08:54:14.415395Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":"# What is maximum and minimum value of Basic_Demo_age","metadata":{}},{"cell_type":"code","source":"maxAge = dfTrain[\"Basic_Demos-Age\"].max()\nprint(maxAge)\nminAge = dfTrain[\"Basic_Demos-Age\"].min()\nprint(minAge)","metadata":{"execution":{"iopub.status.busy":"2024-11-06T08:58:25.944417Z","iopub.execute_input":"2024-11-06T08:58:25.945619Z","iopub.status.idle":"2024-11-06T08:58:25.953557Z","shell.execute_reply.started":"2024-11-06T08:58:25.945567Z","shell.execute_reply":"2024-11-06T08:58:25.952232Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":"# What is maximum and minimum age of fall, winter, summer, spring","metadata":{}},{"cell_type":"code","source":"maxFall = 0\nansMaxFall = 0\nminFall = 15\nansMinFall = 15\nmaxSummer = 0\nansMaxSummer = 0\nminSummer = 15\nansMinSummer = 15\nmaxSpring = 0\nansMaxSpring = 0\nminSpring = 15\nansMinSpring = 15\nmaxWinter = 0\nansMaxWinter = 0\nminWinter = 15\nansMinWinter = 15\nfor i in range(len(dfTrain[\"Basic_Demos-Age\"])):\n    if dfTrain[\"Basic_Demos-Enroll_Season\"].iloc[i] == \"Fall\":\n        maxFall =dfTrain[\"Basic_Demos-Age\"].iloc[i]\n        if ansMaxFall < maxFall:\n            ansMaxFall = maxFall\n        minFall = dfTrain[\"Basic_Demos-Age\"].iloc[i]\n        if minFall < ansMinFall:\n            ansMinFall = minFall\n    elif dfTrain[\"Basic_Demos-Enroll_Season\"].iloc[i] == \"Winter\":\n        maxWinter =dfTrain[\"Basic_Demos-Age\"].iloc[i]\n        if ansMaxWinter < maxWinter:\n            ansMaxWinter = maxWinter\n        minWinter = dfTrain[\"Basic_Demos-Age\"].iloc[i]\n        if minWinter < ansMinWinter:\n            ansMinWinter = minWinter\n    elif dfTrain[\"Basic_Demos-Enroll_Season\"].iloc[i] == \"Summer\":\n        maxSummer =dfTrain[\"Basic_Demos-Age\"].iloc[i]\n        if ansMaxSummer < maxSummer:\n            ansMaxSummer = maxSummer\n        minSummer = dfTrain[\"Basic_Demos-Age\"].iloc[i]\n        if minSummer < ansMinSummer:\n            ansMinSummer = minSummer\n    elif dfTrain[\"Basic_Demos-Enroll_Season\"].iloc[i] == \"Spring\":\n        maxSpring =dfTrain[\"Basic_Demos-Age\"].iloc[i]\n        if ansMaxSpring < maxSpring:\n            ansMaxSpring = maxSpring\n        minSpring = dfTrain[\"Basic_Demos-Age\"].iloc[i]\n        if minSpring < ansMinSpring:\n            ansMinSpring = minSpring\nprint(ansMaxFall)\nprint(ansMinFall)\nprint(ansMaxWinter)\nprint(ansMinWinter)\nprint(ansMaxSpring)\nprint(ansMinSpring)\nprint(ansMaxSummer)\nprint(ansMinSummer)\n        ","metadata":{"execution":{"iopub.status.busy":"2024-11-06T09:46:43.612056Z","iopub.execute_input":"2024-11-06T09:46:43.612505Z","iopub.status.idle":"2024-11-06T09:46:43.951778Z","shell.execute_reply.started":"2024-11-06T09:46:43.612462Z","shell.execute_reply":"2024-11-06T09:46:43.950483Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":"# How many 0's and 1's of of Basic demo sex and with maximum and minimum age","metadata":{}},{"cell_type":"code","source":"countMax0 = 0\ncountMax1 = 1\ncountMin0 = 0\ncountMin1 = 1\nfor i in range(len(dfTrain[\"Basic_Demos-Age\"])):\n    if dfTrain[\"Basic_Demos-Age\"].iloc[i] == 5 and dfTrain[\"Basic_Demos-Sex\"].iloc[i] == 0:\n        countMin0 += 1\n    elif dfTrain[\"Basic_Demos-Age\"].iloc[i] == 22 and dfTrain[\"Basic_Demos-Sex\"].iloc[i] == 0:\n        countMax0 += 1\n    elif dfTrain[\"Basic_Demos-Age\"].iloc[i] == 5 and dfTrain[\"Basic_Demos-Sex\"].iloc[i] == 1:\n        countMin1 += 1\n    elif dfTrain[\"Basic_Demos-Age\"].iloc[i] == 22 and dfTrain[\"Basic_Demos-Sex\"].iloc[i] == 1:\n        countMax1 += 1\n        \n        \nprint(countMin0)\nprint(countMax0)\nprint(countMin1)\nprint(countMax1)","metadata":{"execution":{"iopub.status.busy":"2024-11-07T04:34:20.195180Z","iopub.execute_input":"2024-11-07T04:34:20.195640Z","iopub.status.idle":"2024-11-07T04:34:20.490439Z","shell.execute_reply.started":"2024-11-07T04:34:20.195599Z","shell.execute_reply":"2024-11-07T04:34:20.489108Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":"So Minimum age male is maximum all of this 76 and min age female is also greater than maximum age which is 37","metadata":{}},{"cell_type":"markdown","source":"# Value count of CGSA sesson","metadata":{}},{"cell_type":"code","source":"vCOfCGSA = dfTrain[\"CGAS-Season\"].value_counts()\nprint(vCOfCGSA)","metadata":{"execution":{"iopub.status.busy":"2024-11-07T04:40:31.573997Z","iopub.execute_input":"2024-11-07T04:40:31.574458Z","iopub.status.idle":"2024-11-07T04:40:31.588938Z","shell.execute_reply.started":"2024-11-07T04:40:31.574410Z","shell.execute_reply":"2024-11-07T04:40:31.587814Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":"So we Conclude from this Sping has maximum value 697 and winter have minimum value 567","metadata":{}},{"cell_type":"markdown","source":"# What is maximum and minimum CGAS_Score and its came how many times","metadata":{}},{"cell_type":"code","source":"maxCGASS = dfTrain[\"CGAS-CGAS_Score\"].max()\nminCGASS = dfTrain[\"CGAS-CGAS_Score\"].min()\ncountMin = 0\ncountMax = 0\nfor i in range(len(dfTrain[\"CGAS-CGAS_Score\"])):\n    if dfTrain[\"CGAS-CGAS_Score\"].iloc[i] == maxCGASS:\n        countMax += 1\n    elif dfTrain[\"CGAS-CGAS_Score\"].iloc[i] == minCGASS:\n        countMin += 1\nprint(maxCGASS)\nprint(minCGASS)\nprint(countMax)\nprint(countMin)","metadata":{"execution":{"iopub.status.busy":"2024-11-07T04:50:41.066809Z","iopub.execute_input":"2024-11-07T04:50:41.068172Z","iopub.status.idle":"2024-11-07T04:50:41.241856Z","shell.execute_reply.started":"2024-11-07T04:50:41.068112Z","shell.execute_reply":"2024-11-07T04:50:41.240588Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":"# Value counts of Physical session is","metadata":{}},{"cell_type":"code","source":"vCofPS = dfTrain[\"Physical-Season\"].value_counts()\nprint(vCofPS)","metadata":{"execution":{"iopub.status.busy":"2024-11-07T04:52:56.802205Z","iopub.execute_input":"2024-11-07T04:52:56.802640Z","iopub.status.idle":"2024-11-07T04:52:56.810684Z","shell.execute_reply.started":"2024-11-07T04:52:56.802597Z","shell.execute_reply":"2024-11-07T04:52:56.809552Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":"So we conclude that spring have maximum value and fall have minimum value","metadata":{}},{"cell_type":"markdown","source":"# What is maximum and minimum values of Physical Height, Pysical Weight and Physical-BMI","metadata":{}},{"cell_type":"code","source":"maxPH = dfTrain[\"Physical-Height\"].max()\nminPH = dfTrain[\"Physical-Height\"].min()\nmaxPW = dfTrain[\"Physical-Weight\"].max()\nminPW = dfTrain[\"Physical-Weight\"].min()\nmaxPB = dfTrain[\"Physical-BMI\"].max()\nminPB = dfTrain[\"Physical-BMI\"].min()\nprint(maxPH)\nprint(minPH)\nprint(maxPW)\nprint(minPB)\nprint(maxPB)\nprint(minPB)\n","metadata":{"execution":{"iopub.status.busy":"2024-11-07T05:01:26.865628Z","iopub.execute_input":"2024-11-07T05:01:26.866515Z","iopub.status.idle":"2024-11-07T05:01:26.877857Z","shell.execute_reply.started":"2024-11-07T05:01:26.866469Z","shell.execute_reply":"2024-11-07T05:01:26.876584Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"import pandas as pd\n\n# Adjust the file path according to the Kaggle environment structure\nfile_path = '/kaggle/input/child-mind-institute-problematic-internet-use/series_test.parquet/id=00115b9f/part-0.parquet'\n\n# Read the Parquet file\ndfP = pd.read_parquet(file_path, engine='pyarrow')  # Specify 'pyarrow' engine if needed","metadata":{"execution":{"iopub.status.busy":"2024-11-12T03:51:09.516409Z","iopub.execute_input":"2024-11-12T03:51:09.516923Z","iopub.status.idle":"2024-11-12T03:51:09.720724Z","shell.execute_reply.started":"2024-11-12T03:51:09.516879Z","shell.execute_reply":"2024-11-12T03:51:09.719321Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"dfP.head()","metadata":{"execution":{"iopub.status.busy":"2024-11-12T03:51:14.050338Z","iopub.execute_input":"2024-11-12T03:51:14.050989Z","iopub.status.idle":"2024-11-12T03:51:14.074245Z","shell.execute_reply.started":"2024-11-12T03:51:14.050933Z","shell.execute_reply":"2024-11-12T03:51:14.072995Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"dfP.shape","metadata":{"execution":{"iopub.status.busy":"2024-11-07T06:12:10.213352Z","iopub.execute_input":"2024-11-07T06:12:10.214193Z","iopub.status.idle":"2024-11-07T06:12:10.223116Z","shell.execute_reply.started":"2024-11-07T06:12:10.214140Z","shell.execute_reply":"2024-11-07T06:12:10.222078Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"dfP['time_of_day_hours'] = dfP['time_of_day'] // 1e12  # Convert from ns to hours\n\n# Group by the rounded time of day (hours) and calculate the mean enmo\nenmo_by_time_of_day = dfP.groupby('time_of_day_hours')['enmo'].mean()\n\n# Plotting\nplt.figure(figsize=(10, 6))\nenmo_by_time_of_day.plot(kind='line', marker='o')\nplt.title('Average ENMO Throughout Different Times of Day')\nplt.xlabel('Time of Day (Hours)')\nplt.ylabel('Average ENMO')\nplt.grid()\nplt.show()","metadata":{"execution":{"iopub.status.busy":"2024-11-11T10:19:53.054236Z","iopub.execute_input":"2024-11-11T10:19:53.055388Z","iopub.status.idle":"2024-11-11T10:19:53.367098Z","shell.execute_reply.started":"2024-11-11T10:19:53.055341Z","shell.execute_reply":"2024-11-11T10:19:53.365876Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":"# Is there a correlation between movement (represented by X, Y, and Z values) and other parameters like battery_voltage or light?","metadata":{}},{"cell_type":"code","source":"columns_of_interest = ['X', 'Y', 'Z', 'light', 'battery_voltage']\ncorrelation_matrix = dfP[columns_of_interest].corr()\n\n# Plotting the correlation matrix\nplt.figure(figsize=(8, 6))\nsns.heatmap(correlation_matrix, annot=True, cmap=\"coolwarm\", vmin=-1, vmax=1)\nplt.title('Correlation Matrix of Movement and Other Parameters')\nplt.show()","metadata":{"execution":{"iopub.status.busy":"2024-11-11T10:22:48.242372Z","iopub.execute_input":"2024-11-11T10:22:48.242809Z","iopub.status.idle":"2024-11-11T10:22:48.612545Z","shell.execute_reply.started":"2024-11-11T10:22:48.242749Z","shell.execute_reply":"2024-11-11T10:22:48.611371Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":"# How does battery voltage (battery_voltage) vary with the device's usage over time?","metadata":{}},{"cell_type":"code","source":"plt.figure(figsize=(10, 6))\nplt.plot(dfP['step'], dfP['battery_voltage'], marker='o', linestyle='-', color='b')\nplt.title('Battery Voltage Over Time')\nplt.xlabel('Step (Time Progression)')\nplt.ylabel('Battery Voltage')\nplt.grid(True)\nplt.show()","metadata":{"execution":{"iopub.status.busy":"2024-11-11T10:26:03.692868Z","iopub.execute_input":"2024-11-11T10:26:03.693328Z","iopub.status.idle":"2024-11-11T10:26:04.075587Z","shell.execute_reply.started":"2024-11-11T10:26:03.693289Z","shell.execute_reply":"2024-11-11T10:26:04.074523Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":"# Is there any observable pattern or significant drop in battery_voltage associated with increased enmo levels or certain times of the day? ","metadata":{}},{"cell_type":"code","source":"dfP['time_of_day_hours'] = dfP['time_of_day'] // 1e12\n\n# Scatter plot to observe battery_voltage variation with enmo and time_of_day\nplt.figure(figsize=(14, 6))\n\n# Plot 1: Battery Voltage vs. ENMO\nplt.subplot(1, 2, 1)\nsns.scatterplot(data=dfP, x='enmo', y='battery_voltage', hue='time_of_day_hours', palette='viridis')\nplt.title('Battery Voltage vs. ENMO')\nplt.xlabel('ENMO')\nplt.ylabel('Battery Voltage')\n\n\n# Plot 2: Battery Voltage vs. Time of Day with ENMO levels\nplt.subplot(1, 2, 2)\nsns.scatterplot(data=dfP, x='time_of_day_hours', y='battery_voltage', hue='enmo', palette='coolwarm')\nplt.title('Battery Voltage Over Time of Day')\nplt.xlabel('Time of Day (Hours)')\nplt.ylabel('Battery Voltage')\n\n\nplt.tight_layout()\nplt.show()","metadata":{"execution":{"iopub.status.busy":"2024-11-11T10:30:04.148199Z","iopub.execute_input":"2024-11-11T10:30:04.148593Z","iopub.status.idle":"2024-11-11T10:30:10.521534Z","shell.execute_reply.started":"2024-11-11T10:30:04.148559Z","shell.execute_reply":"2024-11-11T10:30:10.520436Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":"# How does the light exposure change throughout the day? Is there a pattern that aligns with daylight hours?","metadata":{}},{"cell_type":"markdown","source":"","metadata":{}},{"cell_type":"code","source":"# Convert `time_of_day` to hours if necessary (assuming it's in nanoseconds here)\ndfP['time_of_day_hours'] = dfP['time_of_day'] // 1e12  # Convert from nanoseconds to hours\n\n# Calculate average light exposure by each hour of the day\nlight_by_time_of_day = dfP.groupby('time_of_day_hours')['light'].mean()\n\n# Plotting\nplt.figure(figsize=(10, 6))\nplt.plot(light_by_time_of_day.index, light_by_time_of_day.values, marker='o', color='orange')\nplt.title('Average Light Exposure Throughout the Day')\nplt.xlabel('Time of Day (Hours)')\nplt.ylabel('Average Light Exposure')\nplt.grid(True)\nplt.xticks(range(int(dfP['time_of_day_hours'].min()), int(dfP['time_of_day_hours'].max()) + 1, 1))\nplt.show()","metadata":{"execution":{"iopub.status.busy":"2024-11-12T03:55:36.470122Z","iopub.execute_input":"2024-11-12T03:55:36.470721Z","iopub.status.idle":"2024-11-12T03:55:37.244392Z","shell.execute_reply.started":"2024-11-12T03:55:36.470631Z","shell.execute_reply":"2024-11-12T03:55:37.243083Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":"# Value count of relative_date_PCIAT","metadata":{}},{"cell_type":"code","source":"vCOfRDP = dfP[\"relative_date_PCIAT\"].value_counts()\nprint(vCOfRDP)\nplt.hist(\"vCOfRDP\")\nplt.show()","metadata":{"execution":{"iopub.status.busy":"2024-11-12T03:59:44.605800Z","iopub.execute_input":"2024-11-12T03:59:44.606295Z","iopub.status.idle":"2024-11-12T03:59:44.773428Z","shell.execute_reply.started":"2024-11-12T03:59:44.606253Z","shell.execute_reply":"2024-11-12T03:59:44.772126Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":"# Maximum and minimum value of relative_date_PCIAT","metadata":{}},{"cell_type":"code","source":"maxRDP = dfP[\"relative_date_PCIAT\"].max()\nprint(maxRDP)\nminRDP = dfP[\"relative_date_PCIAT\"].min()\nprint(minRDP)","metadata":{"execution":{"iopub.status.busy":"2024-11-12T04:02:45.220510Z","iopub.execute_input":"2024-11-12T04:02:45.221785Z","iopub.status.idle":"2024-11-12T04:02:45.232508Z","shell.execute_reply.started":"2024-11-12T04:02:45.221712Z","shell.execute_reply":"2024-11-12T04:02:45.230594Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"for i in range(len(dfP[\"relative_date_PCIAT\"])):\n    if dfP[\"relative_date_PCIAT\"].iloc[i] == 85.0:\n        print(dfP[\"light\"].iloc[i])\n        print(dfP[\"battery_voltage\"].iloc[i])\n        print(dfP[\"time_of_day\"].iloc[i])\n        break\nfor i in range(len(dfP[\"relative_date_PCIAT\"])):\n    if dfP[\"relative_date_PCIAT\"].iloc[i] == 41.0:\n        print(dfP[\"light\"].iloc[i])\n        print(dfP[\"battery_voltage\"].iloc[i])\n        print(dfP[\"time_of_day\"].iloc[i])\n        break\n    ","metadata":{"execution":{"iopub.status.busy":"2024-11-12T04:17:01.375179Z","iopub.execute_input":"2024-11-12T04:17:01.375749Z","iopub.status.idle":"2024-11-12T04:17:02.397792Z","shell.execute_reply.started":"2024-11-12T04:17:01.375695Z","shell.execute_reply":"2024-11-12T04:17:02.396455Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"","metadata":{},"execution_count":null,"outputs":[]}]}