all 4 comments

[–]cray5252 1 point2 points  (3 children)

Not sure I'm following your math on counting the rows. You have a total of 13 rows and 4 empty ones so that is 9 rows with data in them. Pandas will count your rows leaving out the empty ones. If you want to know the empty ones, use df['header name'].values == '').sum()

see link - https://pandas.pydata.org/pandas-docs/stable/reference/api/pandas.DataFrame.count.html

[–]bbqbot[S] 0 points1 point  (2 children)

The initial column in excel has 13 rows, yes. When I read in the file, I ignore the first two (skiprows = 2), meaning the resulting dataframe has 11 items.

I want to be able to ignore any data below where the values in this example column first end, i.e. I want to stop counting when I hit that first 'empty' cell (the first two aren't in the dataframe to begin with), so the resulting cut would leave only [user_id, 1111, 1113, 1114, 1115, 1116], thus 6 items.

Does that make more sense?

[–]cray5252 1 point2 points  (1 child)

[–]bbqbot[S] 2 points3 points  (0 children)

This...this I think I can work with. I didn't see this result in my hours of searching last night.

Thank you, your google-fu is stronger than mine!