Home > Net >  How to filter a DataFrame column according to tuple index?
How to filter a DataFrame column according to tuple index?

Time:09-16

Here is the old dataframe with my desired output below it.

Old DataFrame

Column
(name,birthday,13)
(name,birthday,14)
(name,birthday,13)
(name,birthday,25)
(name,birthday,16)

New DataFrame

Column
13
14
13
25
16

CodePudding user response:

Try with

df['columns New'] = df['Column'].str[2]
  • Related