Skip to content
Advertisement

How can I create a new pandas DataFrame out of an existing one applying a function to every column without a for loop?

A simplified script I have now working is as follows:

JavaScript

How can I get the same result (a one row dataframe) with a simpler, more efficient code?

Advertisement

Answer

Try with apply:

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