Created
June 26, 2024 13:32
-
-
Save stuaxo/45db5e993c049586d4bb56f243550a1d to your computer and use it in GitHub Desktop.
Output data types of the columns in a parquet file
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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