Reputation: 1
Trying to load data from a zip file however cannot get data from DataFrame. Usually used to importing modules but this file is saved locally.
I've tried implementing different methods but cant seem to get very far.
import pandas as pd
pd_data = pd.read_csv('inventory.zip')
(train_data, train_labels), (test_data, test_labels) = pd_data.load_data(num_words=5000)
Upvotes: 0
Views: 119
Reputation: 2129
Since you are trying to read a zip file, you should use the compression
parameter
pd_data = pd.read_csv('inventory.zip', compression='zip')
An important assumption here is that the data that is compressed IS a .csv file.
Upvotes: 2