0

I have a dataframe scraped from a site, I use pandas and I get:

                                    Name  ... Certification Date
0    Huawei iSitePower V100R022C00SPC120  ...                NaN
1                     Certification Date  ...                NaN
2                       DNIe versión 4.0  ...                NaN
3                     Certification Date  ...                NaN
4                 GuardedBox versión 8.4  ...                NaN
..                                   ...  ...                ...
253                   Certification Date  ...                NaN
254  Samsung S3FW9FV/FT/F9/F8 Revision 0  ...                NaN
255                   Certification Date  ...                NaN
256  Samsung S3FW9FG/F6/F5/F2 revision 0  ...                NaN
257                   Certification Date  ...                NaN

The text 'Certification Date' appears in every to rows, how can I effectively delete rows with that text?

I already searched on Stack Overflow, and I tired: df = df[df.Name != 'Certificate Date'] It doesn't work, I guess this only works with INT datatype, or I didn't use correctly.

Hongbo
  • 5
  • 8
  • 1
    `out = df[df['Name'].ne('Certification Date')]`, or by position: `out = df.iloc[::2]` – mozway Mar 31 '23 at 07:38
  • This works, but how can I solve the id thing as well. Otherwise there are: 0 2 4 8 10 ... I want it to be 0 1 3 4 ... – Hongbo Mar 31 '23 at 07:44
  • `out = out.reset_index(drop=True)`, please make sure to read pandas documentation and to search this site, those are very frequent questions. – mozway Mar 31 '23 at 07:47
  • Thanks so much! I guess I should change my habit, and my ability to read it. The documentation is like a massive book, sometimes I feel annoyed to read for so long and still don't see the key I need. – Hongbo Mar 31 '23 at 08:00

0 Answers0