Melting with not present column does not produce error #23570
Labels
Error Reporting
Incorrect or improved errors from pandas
good first issue
Reshaping
Concat, Merge/Join, Stack/Unstack, Explode
Milestone
Code Sample
Outputs warning:
Problem description
This behavior should produce an error. Warnings aren't always taken seriously and if this melting operation were apart of a larger chain of operations, it would be unclear what the cause of the warning was since the warning does not directly address the actual problem. There is no scenario in which support for melting on non-present columns would be beneficial and there are clear reasons why it would be beneficial to alert users if they've made this mistake.
Expected Output
df.melt(['Name', 'day'], ['Burgers', 'fries'])
should be treated likedf.melt(['Name', 'Day'])
(whereDay
is not present in the df) and produce a Traceback.The text was updated successfully, but these errors were encountered: