我在PySpark中有一个Koalas DataFrame。我想计算列标准偏差。我已经尝试过:
df2['x_std'] = df2[['x_1','x_2','x_3','x_4','x_5','x_6','x_7','x_8','x_9','x_10','x_11','x_12']].std(axis = 1)
我收到以下错误:
TypeError: 'DataFrame' object does not support item assignment
我也在做类似的事情:
d1 = df2[['x_1','x_12']].std(axis = 1)
df2['x_std'] = d1 # d1 is a Koalas Series that should get assigned to the new column.
执行此操作时出现此错误:
Cannot combine column argument because it comes from a different dataframe
对考拉来说是全新的。任何人都可以提出一些想法吗?谢谢。