Skip to content

REGR: passing dask arrays to Series or DataFrame #38645

Closed
@keewis

Description

@keewis

Code Sample, a copy-pastable example

import pandas as pd
import dask.array as da
a = da.ones((12,), chunks=4)
s = pd.Series(a, index=range(12))
print(s.dtype)

Problem description

This has been detected by xarray's upstream-dev CI (environment): with 1.1.3, the dtype is float64 while on master (installed from scipy-wheels-nightly) this became object (and the series / dataframe contains dask scalars). Was that change intentional? Poking around on the merged PR list, this might have been #38563 (not sure, though).

To be clear, for us this only affects test code and since it would compute anyways we can easily work around this by computing the dask array before passing it to pd.Series or pd.DataFrame.

See also pydata/xarray#4717.

cc @TomAugspurger

Metadata

Metadata

Assignees

No one assigned

    Labels

    ConstructorsSeries/DataFrame/Index/pd.array ConstructorsRegressionFunctionality that used to work in a prior pandas version

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions