fixing data error on resample
This commit is contained in:
@@ -323,7 +323,14 @@ def resample(id, r, parent, overwrite='copy'):
|
|||||||
data['datetime'] = data['time'].apply(
|
data['datetime'] = data['time'].apply(
|
||||||
lambda x: startdatetime+datetime.timedelta(seconds=x/1000.))
|
lambda x: startdatetime+datetime.timedelta(seconds=x/1000.))
|
||||||
|
|
||||||
|
try:
|
||||||
data = data.resample('S', on='datetime').mean()
|
data = data.resample('S', on='datetime').mean()
|
||||||
|
except TypeError:
|
||||||
|
data1 = data._get_numeric_data()
|
||||||
|
data1['datetime'] = data['datetime']
|
||||||
|
data = data1.resample('S', on='datetime').mean()
|
||||||
|
|
||||||
|
|
||||||
data.interpolate(method='linear', inplace=True)
|
data.interpolate(method='linear', inplace=True)
|
||||||
data.reset_index(drop=True, inplace=True)
|
data.reset_index(drop=True, inplace=True)
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user