I have a dataframe containing mined comments (and responses) that look like this:
Comment_ID | COMMENT
1.0 foo
1.1 re:foo
1.2 re:foo
2.0 foo
The comment ID indicates whether a comment is toplevel or a response via the number. Even numbers are always top level comments (in this example 1.0 and 2.0) . I now want to extract only top level comments from my dataframe. How can I do this?
One solution I came up with was this
df = df[df['Comment_ID'] == 1.0]
but that only yields me one row. I need something like this (that works)
df = df[df['Comment_ID'] == 1.0:300.0]