How to unzip gz file using Python

后端 未结 6 1859
伪装坚强ぢ
伪装坚强ぢ 2020-12-01 02:37

I need to extract a gz file that I have downloaded from an FTP site to a local Windows file server. I have the variables set for the local path of the file, and I know it ca

6条回答
  •  死守一世寂寞
    2020-12-01 03:02

    Maybe you want pass it to pandas also.

    with gzip.open('features_train.csv.gz') as f:
    
        features_train = pd.read_csv(f)
    
    features_train.head()
    

提交回复
热议问题