Skip to content

Instantly share code, notes, and snippets.

@stuaxo
Created June 26, 2024 13:32
Show Gist options
  • Save stuaxo/45db5e993c049586d4bb56f243550a1d to your computer and use it in GitHub Desktop.
Save stuaxo/45db5e993c049586d4bb56f243550a1d to your computer and use it in GitHub Desktop.
Output data types of the columns in a parquet file
DATA_FILE = "your-file.parquet"
import pandas as pd
# Read the Parquet file
df = pd.read_parquet(DATA_FILE)
def df_schema(df):
# Print the column names and their types
for column in df.columns:
print(f"Column: {column}, Type: {df[column].dtype}")
df_schema(df)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment