<分区> 分区>
我想删除 pandas 数据框中以注释字符开头的所有行。例如:
>>> COMMENT_CHAR = '#'
>>> df
first_name last_name
0 #fill in here fill in here
1 tom jones
>>> df.remove(df.columns[0], startswith=COMMENT_CHAR) # in pseudocode
>>> df
first_name last_name
0 tom jones
这实际上是如何完成的?
