Skip to content
Advertisement

Pandas find the maximum num from substring column

I’ve a dataframe look like this

JavaScript

I want to make a separate column based on highest score values.

Like so

JavaScript

I’ve went through many ref but I can’t relate with my problem. Any suggestions?

Advertisement

Answer

You can use pandas.apply with axis=1 for iterate over each row:

JavaScript

Output:

JavaScript

Explanation:

JavaScript
User contributions licensed under: CC BY-SA
1 People found this is helpful
Advertisement