Answer to Question #235915 in Python for aakash

Question #235915

How to fetch a data entry from a pandas dataframe using a given value in index?

To fetch a row from dataframe given index x, we can use loc.

Df.loc[10] where 10 is the value of the index.

Code

get me the code


1
Expert's answer
2021-09-13T18:39:09-0400
data.set_index("x", inplace=True)
data.loc[10]

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
New on Blog
APPROVED BY CLIENTS