def test(row):
print(row)
print('en')
df=pd.DataFrame({‘first’:[1,2,3],’second’:[1,4,5],’third’:[4,2,2]})
df.apply(lambda x :test(x),axis=1)
**axis=0, 传给的x是 按行传递
axis=1 传给的x是 按列传递**
def test(row):
print(row)
print('en')
df=pd.DataFrame({‘first’:[1,2,3],’second’:[1,4,5],’third’:[4,2,2]})
df.apply(lambda x :test(x),axis=1)
**axis=0, 传给的x是 按行传递
axis=1 传给的x是 按列传递**