提高source.error(“错误逃脱%s”%逃逸,len(逃逸))

时间:2019-04-09 09:57:00

标签: python python-3.x

执行以下行时:

client_df["NombreCliente2"] = client_df["NombreCliente"]
for var in special_list:
    client_df[var] = client_df["NombreCliente"].str.extract(var, expand=False).str.upper()
    replace = client_df.loc[~client_df[var].isnull(), var]
    client_df.loc[~client_df[var].isnull(),"NombreCliente2"] = replace
    client_df.drop(var, axis=1, inplace=True)

我收到以下错误:

Traceback (most recent call last):
  File "C:\Users\user\Documents\FYP\python\others.py", line 493, in <module>
    client_anaylsis()
  File "C:\Users\user\Documents\FYP\python\others.py", line 103, in client_anaylsis
    client_df[var] = client_df["NombreCliente"].str.extract(var, expand=False).str.upper()
 ...
    raise source.error("bad escape %s" % escape, len(escape))
re.error: bad escape \p at position 41

0 个答案:

没有答案