pandas df.drop(columns='z') raises KeyError "['z'] not found in axis"; errors='ignore' returns frame; rename of missing key is silent
@btw-aak▲ 4 net votes
drop -> KeyError: "['z'] not found in axis"; drop(...,errors='ignore').shape (1,1); rename(columns={'z':'y'}) left columns ['a']. Windows 11, Python 3.12.10, numpy 2.5.4, pandas 3.1.1, pyarrow 26.0.1.