I have a df with the windspeed and the power. I calculated 6 new columns with ranges around the power. Now I want to check if the windspeed is smaller then 7 and check than if the power is smaller than the value my column '-10' or greater then the value in my column '+10'. If it is out of this range I want to count +1 if nothing schould happens and I want to check the next power value.
x=df.T.iloc[0]
y=df.T.iloc[1]
c=result[0]
a=result[1]
b=result[2]
df['soll'] = c / (1 + (a) * np.exp(-b*(x)))
df['+3'] = df['soll'] + (c * 0.03)
df['-3'] = df['soll'] - (c * 0.03)
df['+6'] = df['soll'] + (c * 0.06)
df['-6'] = df['soll'] - (c * 0.06)
df['+10'] = df['soll'] + (c * 0.1)
df['-10'] = df['soll'] - (c * 0.1)
counter = 0
for number in df['power']:
if df['windspeed'] <= 7:
np.where((df['+10'] >= df['power']) & (df['-10'] <= df['power'])
, counter+=1,
elif df['windspeed'] <= 15 & >7:
np.where((df['+6'] >= df['power']) & (df['-6'] <= df['power'])
, counter+=1,
else:
np.where((df['+3'] >= df['power']) & (df['-3'] <= df['power'])
, counter+=1
)
)
)
This is a part of my df:
windspeed power soll +3 -3 +6 -6 +10 -10
0 6.1 230.0 210.29186534841182 266.3048877761675 154.27884292065613 322.31791020392313 98.26582049290047 397.0019401075974 23.581790589226216
1 6.4 271.0 245.18211360320805 301.19513603096374 189.16909117545237 357.20815845871937 133.1560687476967 431.89218836239365 58.47203884402245
2 6.4 270.0 245.18211360320805 301.19513603096374 189.16909117545237 357.20815845871937 133.1560687476967 431.89218836239365 58.47203884402245
3 6.0 219.0 199.6625381512033 255.675560578959 143.64951572344762 311.6885830067147 87.63649329569196 386.3726129103889 12.952463392017705
4 6.9 338.0 314.1478597411359 370.1608821688916 258.1348373133802 426.1739045966473 202.12181488562456 500.8579345003215 127.4377849819503
5 6.9 345.0 314.1478597411359 370.1608821688916 258.1348373133802 426.1739045966473 202.12181488562456 500.8579345003215 127.4377849819503
6 6.9 338.0 314.1478597411359 370.1608821688916 258.1348373133802 426.1739045966473 202.12181488562456 500.8579345003215 127.4377849819503
7 6.2 251.0 221.4119211836951 277.4249436114508 165.39889875593946 333.43796603920646 109.38587632818377 408.12199594288074 34.70184642450951
Aucun commentaire:
Enregistrer un commentaire