I'm trying to sum my dataframe across axis = 1 but for some reason its not working for me. I'm not entirely sure why its not working. Any help would be appreciated.
Original DataFrame:
Attempt at summing along axis = 1
There is problem type
of your data is not float
but string
.
So need cast to float
by astype
:
norm = data[colors.keys()].astype(float).sum(axis=1)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With