How to convert a series of one value to float only?
Use loc
normal_sum.loc[date, 'KWH']
See @MaxU's answer for at
Also get_value
normal_sum.get_value(date, 'KWH')
To return zero when date isn't in the index, you can
normal_sum.KWH.get(date, 0)
if there is only one element in the data series, you could convert it to list by calling tolist()
and taking the first element of the new list by referencing [0]
.