plz error turn off
0 11 1 Störung bei Paketabtransport
1 11 1 Störung bei Paketabtransport
2 11 0 Störung bei Paketabtransport
3 127 3 Sicherheitstür (0SS5c.2) bei
4 11 0 Störung bei Paketabtransport 我想在列‘0's’错误‘之后过滤df,如何获得带有0和它的协同响应行的新df?
df = df['error'] < 1基本上是这样的,但只添加了响应行
发布于 2019-11-26 12:03:35
你是说那种事吗?
df = pd.DataFrame(data=[[11,0,'txt'],[11, 1, 'txt'],[11, 1, 'txt'], [11, 0, 'txt']], columns = ['plz', 'error', 'turn_off'])
>>>
plz error turn_off
0 11 0 txt
1 11 1 txt
2 11 1 txt
3 11 0 txt
new_df = df[df['error'] == 0]
>>>
plz error turn_off
0 11 0 txt
3 11 0 txthttps://stackoverflow.com/questions/59048964
复制相似问题