Python Forum

Full Version: Basic Pandas, obtaining a value from column and row
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hi all,

Getting back into coding, I have a data file (named AC) using PANDAS which reads an XLSX file. I want to retrieve the value that corresponds to a certain registration and the column name MOMENT. (E.G I want to extract the value 2099 given the registration GDAKM)
Any help would be appreciated, been stuck on it for quite a while now!

I have added screen shot of my data file

Many Thanks!
You should post a working DataFram(not image) and what you have tried.
Then it easier to test out stuff,can not use the image.
Try:
df.query('REGISTRATION=="GDAKM"')['MOMENT'] 
Getting info at a row and column you use iloc. To locate using the names of a location, use loc
See iloc, see also loc