irkinosor
irkinosor

Reputation: 776

Google Colab unzipped file won't appear

I have downloaded some datasets via Kaggle API into Colab. However, after unzipping them they do not appear in my directory and I can read them with pandas

Colab commands

As you can see the file where successfully unzip and then I unzip them again as I couldn't find them. However, they do no appear in the directory as I mentioned. Furthermore the pd.read_csv can't read either the csv files that don't show or the csv.zip that show using compression = zip argument. I get

FileNotFoundError: File b'/data/train.csv' does not exist
FileNotFoundError: [Errno 2] No such file or directory: 'data/train.csv.zip'

Any idea what's going on?

Upvotes: 2

Views: 2216

Answers (1)

0101
0101

Reputation: 1076

try unzipping them individually like

!unzip train.csv.zip

then do

train = pd.read_csv('train.csv', nrows=6000000, dtype={'acoustic_data': np.int16, 'time_to_failure': np.float64})

I got this from this github repo, which you can follow the steps for or just import into colab then replace it with your data

https://github.com/llSourcell/Kaggle_Earthquake_challenge/blob/master/Earthquake_Challenge.ipynb

you can import .ipynb notebooks through searching for them in colab

Upvotes: 1

Related Questions