As per the title, I am trying to combine the row values from different cudf.DataFrame columns. The following code works for a standard pandas.DataFrame:
import pandas as pd
data = {'a': [1], 'b': [2], 'c': [3], 'd': [4]}
df = pd.DataFrame.from_dict(data)
def f(row):
return {'dictfromcolumns': [row['a'], row['b'], row['c'], row['d']]}
df['new'] = df.apply(f, axis=1)
The equivalent code with cudf, should look like:
dfgpu = cudf.DataFrame(df)
dfgpu['new'] = dfgpu.apply(f, axis=1)
But this will throw the following ValueError exception:
ValueError: user defined function compilation failed.
Is there an alternative way to accomplish the combination of cudf columns (in my case I need to create a dict and store it as the value in a new column)
Thanks!