Skip to content

DOC: DataFrame.unstack should accept fill_value with more types than just int/str/dict #61445

Closed
@loicdiridollou

Description

@loicdiridollou

Pandas version checks

  • I have checked that the issue still exists on the latest versions of the docs on main here

Location of the documentation

https://pandas.pydata.org/docs/dev/reference/api/pandas.DataFrame.unstack.html#pandas.DataFrame.unstack

Documentation problem

Currently the docs stipulate that only int, str and dict are allowed for the fill_value, yet it seems like all the types that could be used when creating a DataFrame seem to pass at runtime. I have not tried them all yet but int, float, complex, timestamp are working fine.

Suggested fix for documentation

Add all allowed types for dataframe elements for the fill_value field.
Happy to create the PR if this is agreed by the maintainers. I will raise the issue in the pandas-stubs repo.

Metadata

Metadata

Assignees

Labels

DocsReshapingConcat, Merge/Join, Stack/Unstack, Explode

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions