I'm using cuDF v0.10.0 and trying to append two dataframes (adding rows, not joining columns.) In pandas, I might do something like this:
df1 = df = pd.DataFrame({"a":[1, 2, 3, 4], "b":[5, 6, 7, 8]})
df2 = pd.DataFrame({"a":[1, 2, 3], "b":[5, 6, 7]})
df.append(df2, ignore_index = True)
I'm trying to find similar functionality with cuDF. I looked on the docs and the "concat" function seems to offer this:
https://rapidsai.github.io/projects/cudf/en/0.10.0/api.html#cudf.core.reshape.concat
However, I cannot find the concat function. Is there a sample invocation to demonstrate this?
I am also struggling to use concat on rapids data frames.
Please feel free to file a feature request for .append, or comment on an append issue if one exists. This would be a valuable addition.
We expose concat as a module-level function like pandas.
import pandas as pd
df = pd.DataFrame({"a":[1, 2, 3, 4], "b":[5, 6, 7, 8]})
df2 = pd.DataFrame({"a":[1, 2, 3], "b":[5, 6, 7]})
pd.concat([df, df2], ignore_index = True)
import cudf
df = cudf.DataFrame({"a":[1, 2, 3, 4], "b":[5, 6, 7, 8]})
df2 = cudf.DataFrame({"a":[1, 2, 3], "b":[5, 6, 7]})
cudf.concat([df, df2], ignore_index = True)
聽 | a | b
-- | -- | --
1 | 5
2 | 6
3 | 7
4 | 8
1 | 5
2 | 6
3 | 7
You both may also be interested in 10 Minutes to cuDF from our API docs page, which covers some useful functionality like this.
Closing this issue as resolved.
Most helpful comment
Please feel free to file a feature request for
.append, or comment on anappendissue if one exists. This would be a valuable addition.We expose concat as a module-level function like pandas.
You both may also be interested in 10 Minutes to cuDF from our API docs page, which covers some useful functionality like this.