flyboi
flyboi

Reputation: 1

Trouble loading data for train labels

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

Answers (1)

Juan Carlos Ramirez
Juan Carlos Ramirez

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

Related Questions