I'm working with a parquet file in python with Pandas and I got a surprise.
The parquet file that I read weighs 290MB and when I do a filtering to remove records from that dataframe and save it with df.to_parquet() I find that the new parquet weighs 390MB
How can that be?
Here my code example:
df = read_parquet('path/to/file.parquet')
ids_to_remove = ['id1','id2']
def filterout(df):
return df[~df.id.isin(ids_to_remove)]
filtered_df = filterout(df)
filtered_df.to_parquet('path/to/save/filtered.parquet')