Python Forum
Basic Pandas, obtaining a value from column and row
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Basic Pandas, obtaining a value from column and row
#1
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!
likes this post

Attached Files

Thumbnail(s)
   
Reply
#2
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'] 
JamesOzone likes this post
Reply
#3
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
JamesOzone likes this post
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  Python Alteryx QS-Passing pandas dataframe column inside SQL query where condition sanky1990 0 690 Dec-04-2023, 09:48 PM
Last Post: sanky1990
  pandas : problem with conditional filling of a column Xigris 2 594 Jul-22-2023, 11:44 AM
Last Post: Xigris
  How to assign a value to pandas dataframe column rows based on a condition klllmmm 0 799 Sep-08-2022, 06:32 AM
Last Post: klllmmm
  Float Slider - Affecting Values in Column 'Pandas' planckepoch86 0 1,370 Jan-22-2022, 02:18 PM
Last Post: planckepoch86
  pandas pivot table: How to find count for each group in Index and Column JaneTan 0 3,228 Oct-23-2021, 04:35 AM
Last Post: JaneTan
  Python Pandas: How do I extract all the >1000 data from a certain column? JaneTan 0 1,531 Jul-17-2021, 09:09 AM
Last Post: JaneTan
  Pandas DataFrame combine rows by column value, where Date Rows are NULL rhat398 0 2,083 May-04-2021, 10:51 PM
Last Post: rhat398
  Pandas, Assign a value in a row, to another column based on a condition klllmmm 6 5,315 Oct-16-2020, 04:43 PM
Last Post: klllmmm
  How to diff pandas rows and modify column value Mekala 1 1,654 Sep-18-2020, 12:38 PM
Last Post: Mekala
  Merge CSV Column using Pandas Data Frames davidlang 1 2,587 May-01-2020, 02:43 PM
Last Post: klllmmm

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020