1

I have a pandas dataframe, all the columns are objects type. I am trying to convert it to cudf by typing cudf.from_pandas(df) but I have this error:

ArrowTypeError: Expected a bytes object, got a 'int' object

I don't understand why even that columns are string and not int. My second question is how to append to a cudf a new element ( like pandas : df. append())

talonmies
  • 70,661
  • 34
  • 192
  • 269
el abed houssem
  • 350
  • 1
  • 7
  • 16
  • 1
    Could you add a reproducible example for the error above? It's a somewhat generic error where I'm unclear how you arrived to it specifically. – Keith Kraus Mar 10 '20 at 17:04

1 Answers1

2

cudf does have an df.append() capability for Series.

import cudf
df1 = cudf.DataFrame({'a': [0, 1, 2, 3],'b': [0.1, 0.2, 0.3, 0.4]})
df2 = cudf.DataFrame({'a': [4, 5, 6, 7],'b': [0.1, 0.2, None, 0.3]}) #your new elements
df3= df1.a.append(df2.a)
df3

Output:

0    0
1    1
2    2
3    3
0    4
1    5
2    6
3    7
Name: a, dtype: int64
TaureanDyerNV
  • 1,208
  • 8
  • 9