pandas 必会函数apply 的坑
import pandas as pd
s = pd.Series(['dsafasdf','3333333333333', '23423', 'sdafasdfasdf'])
def yasuo(x):
return ['...' for i in x]
aaaa=pd.DataFrame([['1aaaaaaaa','2aaaaaaaaaaa'],['aaaaaaaaa2','aa34']])
squared = aaaa.apply(yasuo ,axis=0)
可以看到上面代码apply里面的每一个元素是一个series. 所以作用函数yasuo还要写一个for循环在里面才行!!!!!!!\
如果实在总bug, 还是iloc, for循环吧.