Hi am looking to import part of a spreadsheet as a data frame using pandas but the problem is the spreadsheet changes weekly and the number of rows and columns varies each week.
In Excel VBA I can programmatically determine the number of columns and rows in an excel spreadsheet, but how do I determine that in python??
col-1 | col -2
1. blue
2. green
3. blue
4. blank
5. blank
I need some python code preferably a parameter of the python - pandas method read_excel which tells me that the number of columns in the document I pass to it is 2, and the number of rows is 5 or 6 if you include header.
However I need this to be programmable (called each time) because I want to feed it spreadsheets of different sizes with different numbers of columns.
Use
fillna
with method 'ffill'In [85]: