Private
Public Access
1
0

dataprep routine fusing two dataframes

This commit is contained in:
Sander Roosendaal
2017-02-24 15:57:20 +01:00
parent 6f02e86e63
commit 97189ef02b
2 changed files with 22 additions and 2 deletions

View File

@@ -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

View File

@@ -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()