Skip to content

Commit a308982

Browse files
Create excel_inspector.py
excel inspector in python
1 parent ce023fb commit a308982

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

excel_inspector/excel_inspector.py

+16
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
# Parse spreadsheets and its sheets ===========================================
2+
import pandas as pd
3+
import os
4+
5+
sheets_folder = r''
6+
7+
for path, subdirs, files in os.walk(sheets_folder):
8+
for filename in files:
9+
print('\n [] File:', filename, '===============')
10+
if filename.endswith('.xlsx'):
11+
excel = pd.ExcelFile(path + '\\' + filename)
12+
print('Number of sheets:', len(excel.sheet_names))
13+
print('Sheet names:', excel.sheet_names)
14+
for sheet in excel.sheet_names:
15+
df = excel.parse(sheet)
16+
print('Sheet:', sheet, ' with the columns:', list(df.columns) )

0 commit comments

Comments
 (0)