sticky-angle-28419
06/18/2023, 10:27 PM"['\\ufeffID'] not found in axis"
The original code is:
df.drop([r"\ufeffID"], axis=1, inplace=True)
So it looks like another escape character is added during execution?flat-minister-9355
06/19/2023, 2:05 AMdf.drop("\ufeffID", axis=1, inplace=True)
r”" is used to denote rawstring, which will recognize “\u” as two separate character.sticky-angle-28419
06/19/2023, 2:06 AMdf.drop(["\ufeffID"], axis=1, inplace=True)
- it changes it errors out with an extra escape char: "['\\ufeffID'] not found in axis"
flat-minister-9355
06/19/2023, 2:11 AM["\ufeffID"]
just use "\ufeffID"
insteadsticky-angle-28419
06/19/2023, 2:12 AMflat-minister-9355
06/19/2023, 2:17 AMcols = df.columns.drop("\ufeffID")
df = df[cols]