筛选第0行满足 'Edge'|'Center/Edge' 的所有列, 下面写的不太对劲, 应该是我没有指定第0行,然后表格里有很多NAN, 如何指定第0行呢?以及有没有更好的写法,报错在底下,谢谢
data_Y = data_Y.dropna(axis='columns', how ='all') # 提出edge , Center/Edge列
df = pd.DataFrame()
for col in data_Y.columns:
if data_Y[data_Y[col].str.contains('Edge','Center/Edge')].empty:
pass
else:
df = data_Y[data_Y[col].str.contains('Edge','Center/Edge')]
df = pd.concat([df,data_Y])
报错如下, 应该是我没有指定第0行,然后表格里有很多NAN, 如何指定第0行呢:
File "C:\Users\Anaconda3_64\lib\site-packages\pandas\core\common.py", line 114, in is_bool_indexer
raise ValueError(na_msg)
ValueError: Cannot mask with non-boolean array containing NA / NaN values