dataprep routine fusing two dataframes
This commit is contained in:
@@ -773,6 +773,26 @@ def smalldataprep(therows,xparam,yparam1,yparam2):
|
|||||||
|
|
||||||
return df
|
return df
|
||||||
|
|
||||||
|
# data fusion
|
||||||
|
def datafusion(id1,id2,column,offset):
|
||||||
|
df1 = getrowdata_db(id=id1)
|
||||||
|
columns = ['time',column]
|
||||||
|
df2 = getsmallrowdata_db(columns,ids=[id2])
|
||||||
|
|
||||||
|
keep1 = set(df1.columns)
|
||||||
|
keep1.pop(column)
|
||||||
|
|
||||||
|
for c in df1.columns:
|
||||||
|
if not c in keep1:
|
||||||
|
df1 = df1.drop(c,1,errors='ignore')
|
||||||
|
|
||||||
|
df = pd.concat([df1,df2],ignore_index=True)
|
||||||
|
df = df.sort_value(['time'])
|
||||||
|
df.interpolate(method='linear',axis=0,limit_direction='both')
|
||||||
|
df.fillna(method='bfill',inplace=True)
|
||||||
|
|
||||||
|
return df
|
||||||
|
|
||||||
# This is the main routine.
|
# This is the main routine.
|
||||||
# it reindexes, sorts, filters, and smooths the data, then
|
# it reindexes, sorts, filters, and smooths the data, then
|
||||||
# saves it to the stroke_data table in the database
|
# saves it to the stroke_data table in the database
|
||||||
|
|||||||
@@ -3601,7 +3601,7 @@ def workout_unsubscribe_view(request,id=0):
|
|||||||
comments = WorkoutComment.objects.filter(workout=w,
|
comments = WorkoutComment.objects.filter(workout=w,
|
||||||
user=request.user).order_by("created")
|
user=request.user).order_by("created")
|
||||||
|
|
||||||
for c in comments:
|
for c in comments:
|
||||||
c.notification = False
|
c.notification = False
|
||||||
c.save()
|
c.save()
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user