23 lines
576 B
Python
23 lines
576 B
Python
import sys
|
|
sys.stdout.reconfigure(encoding='utf-8')
|
|
import pandas as pd
|
|
import os
|
|
|
|
file_path = r'c:\Users\NASPC\Documents\Du án tại SG tháng 8\KẾT QUẢ PHÂN TÍCH.xlsx'
|
|
|
|
if not os.path.exists(file_path):
|
|
print("File not found")
|
|
sys.exit()
|
|
|
|
print(f"Reading file: {file_path}")
|
|
xl = pd.ExcelFile(file_path)
|
|
print(f"Sheet names: {xl.sheet_names}\n")
|
|
|
|
for sheet in xl.sheet_names:
|
|
print(f"--- Sheet: {sheet} ---")
|
|
df = xl.parse(sheet)
|
|
print(f"Shape: {df.shape}")
|
|
print(f"Columns: {list(df.columns)}")
|
|
print(f"First few rows:\n{df.head(3)}\n")
|
|
|