Private
Public Access
1
0

ix to loc

This commit is contained in:
Sander Roosendaal
2020-07-16 14:26:57 +02:00
parent b25b600c64
commit f38bd1a50f
2 changed files with 5 additions and 5 deletions

View File

@@ -319,13 +319,13 @@ def getmaxwattinterval(tt,ww,i):
# indexmaxpos = indexmax.get_loc(indexmax) # indexmaxpos = indexmax.get_loc(indexmax)
indexmaxpos = indexmax indexmaxpos = indexmax
try: try:
t_0 = tt.ix[indexmaxpos] t_0 = tt.loc[indexmaxpos]
t_1 = tt.ix[indexmaxpos-i] t_1 = tt.loc[indexmaxpos-i]
deltas = tt.ix[indexmaxpos-i:indexmaxpos].diff().dropna() deltas = tt.loc[indexmaxpos-i:indexmaxpos].diff().dropna()
testres = 1.0e-3*deltas.max() < 30. testres = 1.0e-3*deltas.max() < 30.
if testres: if testres:
deltat = 1.0e-3*(t_0-t_1) deltat = 1.0e-3*(t_0-t_1)
wmax = w_roll.ix[indexmaxpos] wmax = w_roll.loc[indexmaxpos]
#if wmax > 800 or wmax*5.0e-4*deltat > 800.0: #if wmax > 800 or wmax*5.0e-4*deltat > 800.0:
# wmax = 0 # wmax = 0
else: else:

View File

@@ -1189,7 +1189,7 @@ class FusionMetricChoiceForm(ModelForm):
labeldict = {key:value for key,value in self.fields['columns'].choices} labeldict = {key:value for key,value in self.fields['columns'].choices}
for label in labeldict: for label in labeldict:
if df.ix[:,label].std() == 0: if df.loc[:,label].std() == 0:
try: try:
formaxlabels2.pop(label) formaxlabels2.pop(label)
except KeyError: except KeyError: