Python Forum
Apply function on different columns as defined
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Apply function on different columns as defined
#2
try:

data['BMI'] = data[['Weight', 'Height In Meters']].rename(columns = ['Weight', 'Height']).apply(BMI, axis = 1)
Craig "Ichabod" O'Brien - xenomind.com
I wish you happiness.
Recommended Tutorials: BBCode, functions, classes, text adventures
Reply


Messages In This Thread
RE: Apply function on different columns as defined - by ichabod801 - Jun-02-2019, 10:30 AM

Possibly Related Threads…
Thread Author Replies Views Last Post
  apply(pd.Series) until no more array mikisDeWitte 1 2,810 Apr-17-2021, 08:45 PM
Last Post: Caprone
  Outputs "NaN" after "DataFrame columns" function? epsilon 7 3,710 Jan-27-2021, 10:59 AM
Last Post: epsilon
  A function to return only certain columns with certain string illmattic 2 2,232 Jul-24-2020, 12:57 PM
Last Post: illmattic
  Apply rolling window function over time dimension of 3D data Staph 0 2,211 Jan-01-2020, 08:31 AM
Last Post: Staph
  Filter value from DataFrame apply a function and save to xlsx zinho 1 2,053 Dec-22-2019, 03:54 PM
Last Post: zinho
  how to apply user defined function to Pandas DataFrame evelynow 3 7,689 Aug-20-2019, 11:35 PM
Last Post: scidam
  Apply Method Question smw10c 4 5,597 Apr-08-2017, 12:47 PM
Last Post: smw10c

Forum Jump:

User Panel Messages

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