Private
Public Access
1
0
This commit is contained in:
Sander Roosendaal
2019-04-29 22:31:22 +02:00
parent 369f6f47e3
commit 14ee565ae9
3 changed files with 12 additions and 6 deletions

View File

@@ -221,12 +221,15 @@ def filter_df(datadf, fieldname, value, largerthan=True):
except KeyError:
return datadf
if largerthan:
mask = datadf[fieldname] < value
else:
mask = datadf[fieldname] >= value
try:
if largerthan:
mask = datadf[fieldname] < value
else:
mask = datadf[fieldname] >= value
datadf.loc[mask, fieldname] = np.nan
datadf.loc[mask, fieldname] = np.nan
except TypeError:
pass
return datadf

Binary file not shown.

View File

@@ -3155,7 +3155,10 @@ def multiflex_data(request,userid=0,
datadf['date'].replace(datemapping,inplace=True)
today = datetime.date.today()
datadf['days ago'] = map(lambda x : x.days, datadf.date - today)
try:
datadf['days ago'] = map(lambda x : x.days, datadf.date - today)
except TypeError:
datadf['days ago'] = 0
if groupby != 'date':
try: