API: Consistency between DataFrame, MultiIndex.to_frame and reset_index #45245
Labels
API - Consistency
Internal Consistency of API/Behavior
DataFrame
DataFrame data structure
Dtype Conversions
Unexpected or buggy dtype conversions
Uh oh!
There was an error while loading. Please reload this page.
DataFrame, MultiIndex.to_frame, Series.reset_index and DataFrame.reset_index all create DataFrames. In most cases they are the same. But in the following cases they behave differently:
I suggest the following changes:
I would also suggest that both to_frame and reset_index have an additional parameter
allow_duplicates
, default False, but this seems controversial (#44755)...This illustrates the current situation:
The text was updated successfully, but these errors were encountered: