heisenberg
heisenberg

Reputation: 51

How to read data.parquet.gz file in python?

How to read file data.parquet.gz and convert it into a pandas dataframe?

Below code is giving error:

Could not open Parquet input source '': Parquet magic bytes not found in footer. Either the file is corrupted or this is not a parquet file.

df = pd.read_parquet('data.parquet.gz')

Upvotes: 0

Views: 1467

Answers (1)

Stef
Stef

Reputation: 30579

You file is an gzip archive, you can to read is like so:

import gzip

with gzip.open('data.parquet.gz', 'rb') as f:
  df = pd.read_parquet(f)

Upvotes: 3

Related Questions