I have a Koalas DataFrame in PySpark. I want to calculate the column-wise standard deviation. I have tried doing:
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)
I get the following error:
TypeError: 'DataFrame' object does not support item assignment
I also doing something like:
d1 = 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)
df2['x_std'] = d1 # d1 is a Koalas Series that should get assigned to the new column.
I get this error while doing so:
Cannot combine column argument because it comes from a different dataframe
Totally new to Koalas. Can anyone give some ideas? Thanks.