Skip to content
  • Tutorials
    • c programming
      • libraries
    • c++
    • Linux
    • Python
    • batch programming
    • Technology
  • IDE
  • Tools
pandas series select first value 1

pandas series select first value

May 5, 2022 by Anurag batra
df = pd.DataFrame([[1, 2], [3, 4]], ['a', 'b'], ['A', 'B'])
df['A'].iloc[0]  # first item in a Series (Column)

Here is what the above code is Doing:
1. We create a DataFrame with two rows and two columns.
2. We select the first item in the first column.
3. We print the result.

Categories Python Examples
Post navigation
discord.py say something
python search first occurrence in string
© MyEduKit - 2022 . All Rights Reserved.