Skip to content

BUG: .str.cat for all-na corner case #24044

Closed
@h-vetinari

Description

@h-vetinari

A corner case that wrongly casts to FloatIndex if the result is all-na (e.g. due to alignment)

import pandas as pd
>>> idx = pd.Index(['a', 'b', 'c'])
>>> idz = pd.Index(['d', 'e', 'f'])
>>> idx.str.cat(idz, join='left')
Float64Index([nan, nan, nan], dtype='float64')

Metadata

Metadata

Assignees

No one assigned

    Labels

    BugReshapingConcat, Merge/Join, Stack/Unstack, ExplodeStringsString extension data type and string data

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions