7

I need to open a gzipped file, that has a parquet file inside with some data. I am having so much trouble trying to print/read what is inside the file. I tried the following:

with gzip.open("myFile.parquet.gzip", "rb") as f:
    data = f.read()

This does not seem to work, as I get an error that my file id not a gz file. Thanks!

Asker
  • 424
  • 3
  • 5
  • 16

1 Answers1

11

You can use read_parquet function from pandas module:

  1. Install pandas and pyarrow:
pip install pandas pyarrow
  1. use read_parquet which returns DataFrame:
data = read_parquet("myFile.parquet.gzip")
print(data.count()) # example of operation on the returned DataFrame
Gabio
  • 9,126
  • 3
  • 12
  • 32