Skip to content
Advertisement

Pandas: select cell value using pd.at with condition

I’d like to select specific cell values from a Pandas Dataframe. I want to filter out rows with specific values in column A, and then get the values from column B.

From what I understand, the correct way to do this is to use df.at, so I’ve tried

JavaScript

but this doesn’t work. I’ve also tried, as a hack,

JavaScript

doesn’t work either.

What is the right way to do this?

Edit:

What I’m trying to do is to output the values inside of a bigger loop, something like:

JavaScript

Advertisement

Answer

As Anton vBR has pointed out, this should solve your problem

JavaScript

And if you like to get just one value you can do:

JavaScript
Advertisement