There are several issues that I am encountering with Dasc Dataframes.
says I have a data frame with 2 columns ['a','b']
if i want a new column c = a + b
in pandas I would do:
df['c'] = df['a'] + df['b']
In dask, I do the following operation:
df = df.assign(c=(df.a + df.b).compute())
is it possible to write this operation better, similar to what we do in pandas?
The second question is what bothers me more.
In pandas, if I want to change the value of 'a' for lines 2 and 6 to np.pi , I do the following
df.loc[[2,6],'a'] = np.pi
I was not able to figure out how to do a similar operation in Dask. My logic selects multiple rows, and I only want to change the values ββin these rows.
source share