Quantcast
Channel: Recent Questions - Stack Overflow
Viewing all articles
Browse latest Browse all 12111

get first row given by a column value in pandas

$
0
0

I am a newbie to pandas, maybe this is a simple problem, but i can't catch it after searching a lot on google. How can I get the first row given by a column value?

For example, I have the dataframe bellow:

>>> df0  11  12  13  24  2

I want to get the first row where 2 appears, in this example the row is:

>>> df3  2

Note that there is no column name in the dataframe. So, how can I get that? I would appreciate it very much if anyone can provide any help.


Viewing all articles
Browse latest Browse all 12111

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>