I tried to read many articles but I still do not understand clearly applying lambda in Pandas.
For example, I have a df as follow and I want to apply min function to find the minimum value of each row.
a={'a':[1,2,3,-1],'b':[3,4,0,-2],'c':[0,5,100,10]}
df=pd.DataFrame(a)
b=df.apply(lambda x:min(x['a'],x['b'],x['c']),axis=1)
The above works. If I use : b=df.apply(min(df['a'],df['b'],df['c']),axis=1)
, it does not work.
I greatly appreciate your kind explanations.
Thanks.