Source From Here
Question
This seems like a ridiculously easy question... but I'm not seeing the easy answer I was expecting. So, how do I get the value at an nth row of a given column in Pandas? (I am particularly interested in the first row, but would be interested in a more general practice as well).
How-To
To select the ith row, use pandas.DataFrame.iloc/pandas.Series.iloc:
To select the ith value in the 'name' column you could use:
Question
This seems like a ridiculously easy question... but I'm not seeing the easy answer I was expecting. So, how do I get the value at an nth row of a given column in Pandas? (I am particularly interested in the first row, but would be interested in a more general practice as well).
How-To
To select the ith row, use pandas.DataFrame.iloc/pandas.Series.iloc:
To select the ith value in the 'name' column you could use:
沒有留言:
張貼留言