Skip to content

round(A) will be errored, A is pandas.core.series.series but its dtype is object #136367

@dua12138

Description

@dua12138

Bug report

Bug description:

  • my_env_01
    • python 3.10.11 + pandas 2.0.3 + numpy 1.24.4
  • code
import pandas as pd
a = pd.Series([1.1, 2.1])
b = a.astype(object)
round(b)
  • error info
TypeError: loop of ufunc does not support argument 0 of type float which has no callable rint method

but the other env is normal

  • my_env_02
    • python 3.10.14 + pandas 2.0.3 + numpy 1.24.4
  • code
import pandas as pd
a = pd.Series([1.1, 2.1])
b = a.astype(object)
round(b)

code can output normally.

Why does this phenomenon occur?

CPython versions tested on:

3.10

Operating systems tested on:

Windows

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions