0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 1 year has passed since last update.

Pythonでtar.gzファイルを解凍する方法

Posted at

はじめに

自然言語処理のデモのために、livedoorニュースコーパスをダウンロードしてみたらtar.gz形式で圧縮されていたので、その解答の仕方を調べてみた。
忘れそうなので備忘録

※なお、ライブドアコーパスのダウンロードはここ
株式会社ロンウイットが、収集して配布してくださっているデータらしい。便利。

#コード

import tarfile
with tarfile.open('ldcc-20140209.tar.gz') as tar:
    for i in tar.getmembers():
        tar.extractall()

参考

下記を参考にさせていただいております。
https://analytics-note.xyz/machine-learning/download-livedoor-news/

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?