Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
Download

GEP475GROUPINEEDANAP

3818 views
Kernel: Python 3 (Anaconda)
Bottom plot shows CO2_ppm per min ( with accurate time difference )
Next Steps:
  • Converting CO2 per min into Infiltration Rate

  • Think of ways to narrow this down. (of course negative slopes), could do by day of week, time span, or values. (probably all three)

import pandas as pd import numpy as np
df = pd.read_csv('InfiltrationCleanedData.csv', parse_dates = True)
# df.dtypes
df.head(1)
df.drop(df.columns[0], axis = 1, inplace = True)
# df.head()
df.dtypes
CO2 float64 Time object dtype: object
df['Time'] = pd.to_datetime(df.Time)
df.dtypes
CO2 float64 Time datetime64[ns] dtype: object
df['Time2'] = df.Time.shift(-1)
df.head(3)
df['TimeDelta'] = df.Time2 - df.Time df.head(3)
df.dtypes
CO2 float64 Time datetime64[ns] Time2 datetime64[ns] TimeDelta timedelta64[ns] dtype: object
df['TimeDelta'] = df.TimeDelta / np.timedelta64(1, 'm')
df.dtypes
CO2 float64 Time datetime64[ns] Time2 datetime64[ns] TimeDelta float64 dtype: object
df.head()
df['CO2_2'] = df.CO2.shift(-1)
df.head()
df['CO2_diff'] = df.CO2_2 - df.CO2
#df.head()
df['CO2_per_min'] = df.CO2_diff / df.TimeDelta
df.head(3)
df.CO2_per_min.plot()
<matplotlib.axes._subplots.AxesSubplot at 0x7f59a863a780>
Image in a Jupyter notebook
df.CO2_per_min.describe()
count 1.009840e+05 mean NaN std NaN min -inf 25% -1.200000e+00 50% 0.000000e+00 75% 1.000000e+00 max inf Name: CO2_per_min, dtype: float64
# no problems here # df.TimeDelta.describe()
# Task: FIX THIS df.CO2_diff.describe()
count 100984.000000 mean -0.002357 std 14.886084 min -722.000000 25% -6.000000 50% 0.000000 75% 5.000000 max 439.000000 Name: CO2_diff, dtype: float64
df.to_csv('Deltas_rough.csv')