29 lines
835 B
Python
29 lines
835 B
Python
import pandas as pd
|
|
|
|
# Define a list of file paths for easy modification
|
|
file_paths = [
|
|
'sec_data/2024q1/num.txt',
|
|
'sec_data/2024q1/pre.txt',
|
|
'sec_data/2024q1/sub.txt',
|
|
'sec_data/2024q1/tag.txt'
|
|
]
|
|
|
|
# Loop through each file and perform analysis
|
|
for i, file_path in enumerate(file_paths):
|
|
print(f"\nAnalyzing {file_path} (File {i+1}/4)...")
|
|
|
|
# Read the data into a Pandas DataFrame
|
|
df = pd.read_csv(file_path, sep='\t')
|
|
|
|
# Inspect the DataFrame
|
|
print("First rows of the DataFrame:")
|
|
print(df.head(10))
|
|
|
|
# Get the DataFrame Information
|
|
print("\nSummary Information:")
|
|
print(df.info())
|
|
|
|
# Check if there are any missing values in the DataFrame
|
|
missing_values = df.isnull().sum()
|
|
print("\nMissing Values:")
|
|
print(missing_values) |