AttributeError: Can only use .str accessor with string values!

test = df.apply(lambda x: pd.Series([i[0]/(i[1] + 1e-7) for i in zip(height, x)]).str.split(','), axis=1)

正确代码

test = df.apply(lambda x: pd.Series([i[0]/(i[1] + 1e-7) for i in zip(height, x)]).astype(str), axis=1)

你可能感兴趣的:(Python初级,python,大数据,开发语言)