mj.beyrami
mj.beyrami

Reputation: 49

How to import Your own data to google colab

I'm kinda new in python and tensorflow. I want to run my Deep network on a collab for human activity recognition. The problem is I don't know how to import my dataset to collab! I already did upload dataset to Drive. (The dataset link is in below) http://www.cis.fordham.edu/wisdm/dataset.php and I want to just use the WISDM_ar_v1.1_raw.txt file

Upvotes: 0

Views: 3452

Answers (4)

mj.beyrami
mj.beyrami

Reputation: 49

Okey It's solved now! All think you need to do is just upload or data to your drive. (I uploaded in folder name: "app") Then

from google.colab import drive
drive.mount('/content/drive/')

Now by this code you can import the data (Edit: Moved drive.mount to next line):

data = pd.read_csv("/content/drive/My Drive/app/WISDM_ar_v1.1_raw.txt")

Upvotes: 0

ares
ares

Reputation: 504

According to your post you have one redundant bracket that leads to syntax error. Try this

data = pd.read_csv(filepath_or_buffer = 'My Drive/app/WISDM_ar_latest.tar.gz/WISDM_ar_v1.1/WISDM_ar_v1.1_raw.txt',header = None, names = column_names)

Upvotes: 0

mj.beyrami
mj.beyrami

Reputation: 49

column_names = ['user-id','activity','timestamp', 'x-axis', 'y-axis', 'z-axis'] data = pd.read_csv(('My Drive/app/WISDM_ar_latest.tar.gz/WISDM_ar_v1.1/WISDM_ar_v1.1_raw.txt',header = None, names = column_names)

  File "<ipython-input-26-033bf3a3f419>", line 2
    data = pd.read_csv(('My Drive/app/WISDM_ar_latest.tar.gz/WISDM_ar_v1.1/WISDM_ar_v1.1_raw.txt',header = None, names = column_names)
                                                                                                         ^
SyntaxError: invalid syntax

Upvotes: 0

ares
ares

Reputation: 504

You got to mount your google drive in your notebook

from google.colab import drive
drive.mount('/content/drive')

Reference

Upvotes: 1

Related Questions