import glob
import scipy.io
import pandas as pd
# Get a list of all .mat files in the current directory
mat_files = glob.glob("*.mat")
# Initialize an empty list to store the data
data = []
# Loop through each .mat file
for file in mat_files:
# Load the .mat file using scipy.io.loadmat
mat = scipy.io.loadmat(file)
# Extract the data from the .mat file
data.append(mat['data'])
# Create a Pandas dataframe from the data
df = pd.DataFrame(data)
# Print the dataframe
print(df)
1条答案
按热度按时间7d7tgy0s1#