Skip to content

Respect numpy fixed length strings #10351

Closed
@maxnoe

Description

@maxnoe

pandas converts all strings to 'O' columns.

For consistency and writing to files it would be good if pandas respects numpy fixed length strings.

import numpy as np
import pandas as pd

df = pd.DataFrame({'date': np.array(['2015-10-10', '2015-01-01'], dtype='S10')})
print(df.date.dtype)

Results in dtype('O') and not dtype('S10')

Metadata

Metadata

Assignees

No one assigned

    Labels

    API DesignDtype ConversionsUnexpected or buggy dtype conversionsNeeds DiscussionRequires discussion from core team before further action

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions