Hi, one of my tasks is failing with this error: ``...
# flyte-support
s
Hi, one of my tasks is failing with this error:
Copy code
"['\\ufeffID'] not found in axis"
The original code is:
Copy code
df.drop([r"\ufeffID"], axis=1, inplace=True)
So it looks like another escape character is added during execution?
f
try
Copy code
df.drop("\ufeffID", axis=1, inplace=True)
r”" is used to denote rawstring, which will recognize “\u” as two separate character.
s
Sorry that’s what I tried the first time actually:
df.drop(["\ufeffID"], axis=1, inplace=True)
- it changes it errors out with an extra escape char:
"['\\ufeffID'] not found in axis"
f
can you try remove the list notation
["\ufeffID"]
just use
"\ufeffID"
instead
s
OK will try that thanks
f
another approach is selecting only valid column instead of dropping ( I suspect pandas may have problem with UTF-8 column).
Copy code
cols = df.columns.drop("\ufeffID")
df = df[cols]
gratitude thank you 1
164 Views