Spaces:
Running
Running
import pandas as pd | |
def read_excel_file(file_path): | |
try: | |
# Read the Excel file | |
df = pd.read_excel(file_path) | |
# Display the first few rows of the DataFrame | |
print(df.head()) | |
# Check the data types of the columns | |
print(df.dtypes) | |
# Check for missing values | |
print(df.isnull().sum()) | |
return df | |
except Exception as e: | |
print(f"Error reading file: {e}") | |
return null | |
# Specify the file path | |
file_path = '/tmp/tmpyih3q44z.xlsx' | |
# Read the Excel file | |
df = read_excel_file(file_path) | |
# Check for missing values | |
print(df.isnull().sum()) | |
# Display the first few rows of the DataFrame | |
print(df.head()) | |
# Check the data types of the columns | |
print(df.dtypes) | |
# Check summary statistics | |
print(df.describe(include='all')) |