I need to find the maximum value among values in a list. Every element of this list is a pd.Series so when I use the function max(list) I get this error:
"ValueError: The truth value of a Series is ambiguous. Use a.empty, a.bool(), a.item(), a.any() or a.all()."
How can I avoid this problem?
From a Dataframe that look like this:
Date Actual
0 2016-12-30 12:30:00 1800
1 2016-12-30 13:00:00 1800
2 2016-12-30 13:30:00 1600
.
.
.
1256 201-05-30 13:30:00 1500
I create my list:
for single_date in datetime_range(start_date, end_date, timedelta(minutes=30)):
b = find_nearest(df['Date'], single_date)
row = df4[df4['Date'] == b ].index.tolist()
en=(df4.iloc[row]['Actual (kW)'])
energy.append(en)
I need to find the maximum value in the list energy. Thank you