Skip to content

REF: share code between pd.array and Series constructor #27460

Open
@jbrockmendel

Description

@jbrockmendel

I've noticed a couple of places in the code where we do runtime imports of Series just to do values = Series(values)._values. It would be nice to avoid that.

This probably also means moving parts of internals.construction to somewhere like arrays.array_. In particular I think this would require moving sanitize_array and _try_cast. Since sanitize_array is imported by other modules, this would be nice to have non-internals anyway.

Finally there are some functions in dtype.cast that might make more sense alongside sanitize_array, e.g. construct_1d_object_array_from_listlike

Metadata

Metadata

Assignees

No one assigned

    Labels

    ConstructorsSeries/DataFrame/Index/pd.array ConstructorsRefactorInternal refactoring of code

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions