使用正则表达式在dataframe列中返回非数字值

时间:2018-12-23 21:22:50

标签: python regex pandas

显然,我在6000变量的列中具有非整数值,并且需要在此列上运行基本统计信息。我尝试将astype(int)进行转换,但这不起作用,因为我具有非整数值。因此,我无法通过简单地查看这些值来找到它们。我正在尝试使用正则表达式查找非整数变量。这是我尝试过的;

re.findall('[^0-9]', df[VALUE_x])

但我收到此错误:

TypeError: expected string or bytes-like object

但是我已经检查了dtype,它是'O'

0 个答案:

没有答案