Python Forum
Search Results
Post Author Forum Replies Views Posted [asc]
    Thread: Apply function on different columns as defined
Post: RE: Apply function on different columns as defined

(Jun-02-2019, 10:05 PM)ichabod801 Wrote: Do you have two things named BMI? That error makes it look like you named a list the same thing as your function. My function is called BMI, and the column i...
DavidGG Data Science 6 5,018 Jun-03-2019, 06:25 AM
    Thread: Apply function on different columns as defined
Post: RE: Apply function on different columns as defined

(Jun-02-2019, 10:30 AM)ichabod801 Wrote: try: data['BMI'] = data[['Weight', 'Height In Meters']].rename(columns = ['Weight', 'Height']).apply(BMI, axis = 1) Thank you for trying to help. I still ge...
DavidGG Data Science 6 5,018 Jun-02-2019, 12:05 PM
    Thread: Apply function on different columns as defined
Post: Apply function on different columns as defined

I have a function that returns the BMI from a given dataframe with columns 'Weight' and 'Height' Here is the function: def BMI(data): return data['Weight']/(data['Height']**2)Now, i added new colu...
DavidGG Data Science 6 5,018 Jun-02-2019, 08:01 AM
    Thread: How to define a function that calculates the BMI from dataframe
Post: How to define a function that calculates the BMI f...

I need to define a function that will calculate and return out of dataframe that includes columns "Height" and "Weight", the BMI of each row. Here is the code that i wrote: def BMI(DataFrame): ...
DavidGG General Coding Help 2 5,876 May-30-2019, 01:53 PM

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020