pandas apply function to column
df['a'] = df['a'].apply(lambda x: x + 1)
pandas apply function to column
df['a'] = df['a'].apply(lambda x: x + 1)
pandas for column in dataframe
for column in df:
print(df[column])
pandas apply function to each row lambda
def EOQ(D,p,ck,ch):
Q = math.sqrt((2*D*ck)/(ch*p))
return Q
ch=0.2
ck=5
df['Q'] = df.apply(lambda row: EOQ(row['D'], row['p'], ck, ch), axis=1)
df
Copyright © 2021 Codeinu
Forgot your account's password or having trouble logging into your Account? Don't worry, we'll help you to get back your account. Enter your email address and we'll send you a recovery link to reset your password. If you are experiencing problems resetting your password contact us