Reputation: 31
I try download a file in Google Colab
train_url = "https://drive.google.com/file/d/1tBjLm79vkDqn8GulvvKb6FLH5ghmBpMq/view?usp=sharing"
!wget -O train.csv -b train_url &
train = pd.read_csv(r"./train.csv",dtype = np.float32)
Two Questions:
Upvotes: 0
Views: 635
Reputation: 4872
you can read the file directly using pandas
train_url = "https://drive.google.com/file/d/1tBjLm79vkDqn8GulvvKb6FLH5ghmBpMq/view?usp=sharing"
load_url = f'https://drive.google.com/uc?export=download&id={train_url.split('/')[-2]}'
train = pd.read_csv(load_url,dtype = np.float32)
>>>print(train.head())
label pixel0 pixel1 pixel2 ... pixel780 pixel781 pixel782 pixel783
0 1 0 0 0 ... 0 0 0 0
1 0 0 0 0 ... 0 0 0 0
2 1 0 0 0 ... 0 0 0 0
3 4 0 0 0 ... 0 0 0 0
4 0 0 0 0 ... 0 0 0 0
Upvotes: 1