my-phy-dataset / read.py
StarThomas1002's picture
Upload folder using huggingface_hub
8c23886 verified
raw
history blame contribute delete
No virus
1.09 kB
# -*- encoding: UTF-8 -*-
import pandas as pd
# 指定parquet文件的路径
file_path = '/home/yiyangai/stephenqs/datasets/physics_big/data/combined_images_non_empty.parquet'
# 读取parquet文件
df = pd.read_parquet(file_path)
# 获取所有的列名(假设这些列名代表子类)
columns = df.columns
# 遍历所有子类并输出前五条消息
for column in columns:
print(f"--- {column} (前五条消息) ---")
print(df[column].head())
print("\n")
#
## Replace 'file_path' with the path to your Parquet file
#file_path = '/home/yiyangai/stephenqs/datasets/physics_big/data/00001.parquet'
#
## Read the Parquet file
#df = pd.read_parquet(file_path, engine='pyarrow') # or use 'fastparquet' as engine
#
## Display the entire DataFrame
#print("Full DataFrame:")
#print(df)
#
## Display the first 5 rows of the DataFrame
#print("\nFirst 5 rows:")
#print(df.head())
#
## Display basic information about the DataFrame
#print("\nDataFrame Info:")
#print(df.info())
#
## Display summary statistics of the DataFrame
#print("\nSummary Statistics:")
#print(df.describe())