大家好,
I am new to the handling of data in pandas DataFrame could you please help me to solve the problem.
My question is how to replace special symbols(like ?,@,#,$,&,^ and so on) with NaN.
例如:我的CSV文件(((Ram.csv)文件看起来像这样
如果该列仅支持字母,则可以检查字母的ASCII并替换其ASCII与字母的ASCII不匹配的其他任何字符。您可以使用上述登录名将特殊字符替换为空字符串,然后使用用NaN替换它们。
df.replace(r'^\s*$', np.nan, regex=True)