How to use Google Colab to work with local files?
up vote
0
down vote
favorite
I have a Jupiter notebook and I have written codes to work with data. Now I want to use Colab for it's GPU computation power, so I need to read from and write to local files in my computer from Colab. I don't want to select file manually using:
from google.colab import files
uploaded = files.upload()
mentioned in this link where a "select file" pop up will appear, I want this action to be automatically. Let me clarify that:
I have code below where I read data from a local file:
# Reading the csv file and convert it to a dataframe using pandas library
train_set = pd.read_csv('Datasets/train.csv')
Then I per-process data and output the result in another file. To do that, I need to open a file, read the content of it which is the version of my created output file, and then save the output file:
output_version = open('OutputVersion','r+')
version = output_version.read()
training_set.to_csv('Datasets/training_set_processed_{}.csv'.format(version))
So, I have to read, manipulate and write files in my local storage from Colab automatically. How can I do that? I have read this manual but I couldn't get that. Again, I don't want a 'select file' dialogue pop-up.
Thanks in Advance
python-3.x local-storage jupyter-notebook google-colaboratory
add a comment |
up vote
0
down vote
favorite
I have a Jupiter notebook and I have written codes to work with data. Now I want to use Colab for it's GPU computation power, so I need to read from and write to local files in my computer from Colab. I don't want to select file manually using:
from google.colab import files
uploaded = files.upload()
mentioned in this link where a "select file" pop up will appear, I want this action to be automatically. Let me clarify that:
I have code below where I read data from a local file:
# Reading the csv file and convert it to a dataframe using pandas library
train_set = pd.read_csv('Datasets/train.csv')
Then I per-process data and output the result in another file. To do that, I need to open a file, read the content of it which is the version of my created output file, and then save the output file:
output_version = open('OutputVersion','r+')
version = output_version.read()
training_set.to_csv('Datasets/training_set_processed_{}.csv'.format(version))
So, I have to read, manipulate and write files in my local storage from Colab automatically. How can I do that? I have read this manual but I couldn't get that. Again, I don't want a 'select file' dialogue pop-up.
Thanks in Advance
python-3.x local-storage jupyter-notebook google-colaboratory
add a comment |
up vote
0
down vote
favorite
up vote
0
down vote
favorite
I have a Jupiter notebook and I have written codes to work with data. Now I want to use Colab for it's GPU computation power, so I need to read from and write to local files in my computer from Colab. I don't want to select file manually using:
from google.colab import files
uploaded = files.upload()
mentioned in this link where a "select file" pop up will appear, I want this action to be automatically. Let me clarify that:
I have code below where I read data from a local file:
# Reading the csv file and convert it to a dataframe using pandas library
train_set = pd.read_csv('Datasets/train.csv')
Then I per-process data and output the result in another file. To do that, I need to open a file, read the content of it which is the version of my created output file, and then save the output file:
output_version = open('OutputVersion','r+')
version = output_version.read()
training_set.to_csv('Datasets/training_set_processed_{}.csv'.format(version))
So, I have to read, manipulate and write files in my local storage from Colab automatically. How can I do that? I have read this manual but I couldn't get that. Again, I don't want a 'select file' dialogue pop-up.
Thanks in Advance
python-3.x local-storage jupyter-notebook google-colaboratory
I have a Jupiter notebook and I have written codes to work with data. Now I want to use Colab for it's GPU computation power, so I need to read from and write to local files in my computer from Colab. I don't want to select file manually using:
from google.colab import files
uploaded = files.upload()
mentioned in this link where a "select file" pop up will appear, I want this action to be automatically. Let me clarify that:
I have code below where I read data from a local file:
# Reading the csv file and convert it to a dataframe using pandas library
train_set = pd.read_csv('Datasets/train.csv')
Then I per-process data and output the result in another file. To do that, I need to open a file, read the content of it which is the version of my created output file, and then save the output file:
output_version = open('OutputVersion','r+')
version = output_version.read()
training_set.to_csv('Datasets/training_set_processed_{}.csv'.format(version))
So, I have to read, manipulate and write files in my local storage from Colab automatically. How can I do that? I have read this manual but I couldn't get that. Again, I don't want a 'select file' dialogue pop-up.
Thanks in Advance
python-3.x local-storage jupyter-notebook google-colaboratory
python-3.x local-storage jupyter-notebook google-colaboratory
asked Nov 7 at 21:52
Ali Majed HA
1013
1013
add a comment |
add a comment |
1 Answer
1
active
oldest
votes
up vote
0
down vote
You might want to use the file browser in the left hand side in order to upload files.
If you have a lot of files, a simpler method still is to mount your Google Drive in the filesystem.
As I have mentioned in the question, I don't want this action to be manually and using a dialogue box. Files are changing as data is preprocessed in a different way and I want the Colab to read and write file automatically.
– Ali Majed HA
Nov 8 at 6:09
add a comment |
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
0
down vote
You might want to use the file browser in the left hand side in order to upload files.
If you have a lot of files, a simpler method still is to mount your Google Drive in the filesystem.
As I have mentioned in the question, I don't want this action to be manually and using a dialogue box. Files are changing as data is preprocessed in a different way and I want the Colab to read and write file automatically.
– Ali Majed HA
Nov 8 at 6:09
add a comment |
up vote
0
down vote
You might want to use the file browser in the left hand side in order to upload files.
If you have a lot of files, a simpler method still is to mount your Google Drive in the filesystem.
As I have mentioned in the question, I don't want this action to be manually and using a dialogue box. Files are changing as data is preprocessed in a different way and I want the Colab to read and write file automatically.
– Ali Majed HA
Nov 8 at 6:09
add a comment |
up vote
0
down vote
up vote
0
down vote
You might want to use the file browser in the left hand side in order to upload files.
If you have a lot of files, a simpler method still is to mount your Google Drive in the filesystem.
You might want to use the file browser in the left hand side in order to upload files.
If you have a lot of files, a simpler method still is to mount your Google Drive in the filesystem.
answered Nov 7 at 22:01
Bob Smith
5,2791625
5,2791625
As I have mentioned in the question, I don't want this action to be manually and using a dialogue box. Files are changing as data is preprocessed in a different way and I want the Colab to read and write file automatically.
– Ali Majed HA
Nov 8 at 6:09
add a comment |
As I have mentioned in the question, I don't want this action to be manually and using a dialogue box. Files are changing as data is preprocessed in a different way and I want the Colab to read and write file automatically.
– Ali Majed HA
Nov 8 at 6:09
As I have mentioned in the question, I don't want this action to be manually and using a dialogue box. Files are changing as data is preprocessed in a different way and I want the Colab to read and write file automatically.
– Ali Majed HA
Nov 8 at 6:09
As I have mentioned in the question, I don't want this action to be manually and using a dialogue box. Files are changing as data is preprocessed in a different way and I want the Colab to read and write file automatically.
– Ali Majed HA
Nov 8 at 6:09
add a comment |
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53198405%2fhow-to-use-google-colab-to-work-with-local-files%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown