NVIDIA / NVIDIA/cudf

[BUG] `DataFrame.merge` does not assign `dtype` as expected in result as pandas does

Open
#9,981 6 comments 0 reactions 0 assignees View on GitHub
bug Python
Dominant language
C++
Stars
9.8k
Forks
1.1k
Avg merge
3d 6m
Merged PRs (30d)
278

Description

The `dtype` in the result of a merge is inconsistent with the equivalent pandas merge for the same inputs:
cuDF:
```
>>> df1=cudf.DataFrame({"a":[1,2,3,4]})
>>> df2=cudf.DataFrame(columns=["a"])
>>> r=df2.merge(df1,how="outer")
>>> df1["a"].dtype
dtype('int64')
>>> r["a"].dtype
dtype('float64')
```
pandas:
```
>>> pdf1=pd.DataFrame({"a":[1,2,3,4]})
>>> pdf2=pd.DataFrame(columns=["a"])
>>> pr=pdf2.merge(pdf1,how="outer")
>>> pdf1["a"].dtype
dtype('int64')
>>> pr["a"].dtype
dtype('int64')
```

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.