当我使用下面的语句时,它会打印所有系列,然后抛出错误
dff_g.apply(func=print(dff_g['relationship_status']))
错误是
TypeError: ("'NoneType' object is not callable", 'occurred at index marriageId'
marriageId
是数据框的第一列
我的更大目标是使用apply
方法将多个列传递给函数。但这是我得到的一个基本错误
答案 0 :(得分:0)
with fileinput.input(files=('file1.txt', 'file2.txt')) as f:
for line in f:
process(line)
将在所选列上应用print(),没有preshesis,因此传递实际函数而不是函数调用返回的值