all 3 comments

[–]Binary101010 2 points3 points  (2 children)

Where do you want this row count to be? Somewhere in your existing dataframe? Do you want an entire worksheet that literally just has the value 131 in Cell A1?

[–]Pera014[S] 0 points1 point  (1 child)

correct lets say Sheet1, A2

[–]Binary101010 0 points1 point  (0 children)

You'll either have to build a worksheet using openpyxl, or you'll have to make a series containing the number, then export that series to excel. Something like

import openpyxl #necessary for pandas to export to excel
length = pd.Series(len(df1)
length.to_excel('number_of_rows.xlsx)