In Pandas I can use the following to select rows for 4 dates and then change the each date's value in a second column power_table_2
df.loc[df['date'].isin(['2022-03-14','2022-03-22','2022-04-01','2022-04-05']),'power_table_2'] = ['3/96','14/96','7/96','9/96']
In Koalas, I can successfully do the following:
kdf.loc[kdf['date'].isin(['2022-03-17','2022-03-28','2022-03-29','2022-04-01']),'power_table_2'] = '3/96'
But if I do this
kdf.loc[kdf['date'].isin(['2022-03-17','2022-03-28','2022-03-29','2022-04-01']),'power_table_2'] = ['3/96','14/96','7/96','9/96']
I get this error
java.lang.RuntimeException: Unsupported literal type class java.util.ArrayList [3/96, 14/96, 7/96, 9/96]
How can I update multiple values in Koalas like in Pandas?
Thanks
use update
out: