Skip to content
Advertisement

panda dataframe extracting values

I have a dataframe called “nums” and am trying to find the value of the column “angle” by specifying the values of other columns like this:

JavaScript

When I do so, I do not get a singular number and cannot do calculations on them. What am I doing wrong? nums

Advertisement

Answer

First of all, in general you should use .loc rather than concatenate indexes like that:

JavaScript

Now, to get the float, you may use the .item() accessor.

JavaScript
User contributions licensed under: CC BY-SA
1 People found this is helpful
Advertisement