Basically my problem is that I'm trying to create a code that will use Pandas to skip x amount of rows until it reaches a row containing records named departmentName and departmentID. This has been troubling for me because nearly all the questions I've seen have asked about how to skip a specified number of rows but with this issue, there is no specified amount of rows that will be skipped, it could be any amount. So I need a formula that will automatically adapt to this issue. Any ideas?
| Unamed_1 | Unamed_2 |
|---|---|
| Credits | |
| 1 | Math |
| 2 | Computer Science |
| 3 | History |
| 4 | Deep Learning |
This what I have done so far:
for index_1, row_1 in df_cmd.iterrows():
if row_1.notnull().all():
I want to get the name of the row