how to get the file path to my csv file in data assets in watson studio?
up vote
0
down vote
favorite
I have been trying to get the file path of my csv file in watson studio. The file is saved in my project data assets in watson studio. And all I need is the file path to read its content in a jupyter notebook. I'm trying to use a simple python file reader, that should read a file in a specified path. I have tried using watson studio insert file credentials, but can't get it to work.
This works fine when I run the same file in IBM cognitiveclass.ai platform, but I can't get this to work in IBM watson studio, please help.
file name is enrollments.csv
import unicodecsv
with open('enrollments.csv', 'rb') as f:
reader = unicodecsv.DictReader(f)
enrollments = list(reader)
python filereader ibm-watson
add a comment |
up vote
0
down vote
favorite
I have been trying to get the file path of my csv file in watson studio. The file is saved in my project data assets in watson studio. And all I need is the file path to read its content in a jupyter notebook. I'm trying to use a simple python file reader, that should read a file in a specified path. I have tried using watson studio insert file credentials, but can't get it to work.
This works fine when I run the same file in IBM cognitiveclass.ai platform, but I can't get this to work in IBM watson studio, please help.
file name is enrollments.csv
import unicodecsv
with open('enrollments.csv', 'rb') as f:
reader = unicodecsv.DictReader(f)
enrollments = list(reader)
python filereader ibm-watson
add a comment |
up vote
0
down vote
favorite
up vote
0
down vote
favorite
I have been trying to get the file path of my csv file in watson studio. The file is saved in my project data assets in watson studio. And all I need is the file path to read its content in a jupyter notebook. I'm trying to use a simple python file reader, that should read a file in a specified path. I have tried using watson studio insert file credentials, but can't get it to work.
This works fine when I run the same file in IBM cognitiveclass.ai platform, but I can't get this to work in IBM watson studio, please help.
file name is enrollments.csv
import unicodecsv
with open('enrollments.csv', 'rb') as f:
reader = unicodecsv.DictReader(f)
enrollments = list(reader)
python filereader ibm-watson
I have been trying to get the file path of my csv file in watson studio. The file is saved in my project data assets in watson studio. And all I need is the file path to read its content in a jupyter notebook. I'm trying to use a simple python file reader, that should read a file in a specified path. I have tried using watson studio insert file credentials, but can't get it to work.
This works fine when I run the same file in IBM cognitiveclass.ai platform, but I can't get this to work in IBM watson studio, please help.
file name is enrollments.csv
import unicodecsv
with open('enrollments.csv', 'rb') as f:
reader = unicodecsv.DictReader(f)
enrollments = list(reader)
python filereader ibm-watson
python filereader ibm-watson
asked Nov 9 at 11:13


Lawrence Krukrubo
11
11
add a comment |
add a comment |
1 Answer
1
active
oldest
votes
up vote
0
down vote
I assume you mean uploaded the "enrollments.csv" file to Files section.
This uploads file to the Bucket of Cloud Object Storage service which storage for your project.
You can use project-lib to fetch the file url.
# Import the lib
from project_lib import Project
project = Project(sc,"<ProjectId>", "<ProjectToken>")
# Get the url
url = project.get_file_url("myFile.csv")
For more refer this:-
https://dataplatform.cloud.ibm.com/docs/content/analyze-data/project-lib-python.html
https://dataplatform.cloud.ibm.com/analytics/notebooks/v2/a972effc-394f-4825-af91-874cb165dcfc/view?access_token=ee2bd90bee679afc278cdb23453946a3922c454a6a7037e4bd3c4b0f90eb0924
Thanks, I tried it and read all the links but it did not work. I generated the project ID and token successfully, but the code to get url (url = project.get_file_url('enrollments.csv') gives an error message, that says "ValueError: Something went wrong! error message:ProjectCore__get_file_url(): spark context (sc) is not available. This function can't be invoked!!" I have no idea why, it's more than a bit frustrating I must say. But thanks again.
– Lawrence Krukrubo
Nov 12 at 11:40
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
I assume you mean uploaded the "enrollments.csv" file to Files section.
This uploads file to the Bucket of Cloud Object Storage service which storage for your project.
You can use project-lib to fetch the file url.
# Import the lib
from project_lib import Project
project = Project(sc,"<ProjectId>", "<ProjectToken>")
# Get the url
url = project.get_file_url("myFile.csv")
For more refer this:-
https://dataplatform.cloud.ibm.com/docs/content/analyze-data/project-lib-python.html
https://dataplatform.cloud.ibm.com/analytics/notebooks/v2/a972effc-394f-4825-af91-874cb165dcfc/view?access_token=ee2bd90bee679afc278cdb23453946a3922c454a6a7037e4bd3c4b0f90eb0924
Thanks, I tried it and read all the links but it did not work. I generated the project ID and token successfully, but the code to get url (url = project.get_file_url('enrollments.csv') gives an error message, that says "ValueError: Something went wrong! error message:ProjectCore__get_file_url(): spark context (sc) is not available. This function can't be invoked!!" I have no idea why, it's more than a bit frustrating I must say. But thanks again.
– Lawrence Krukrubo
Nov 12 at 11:40
add a comment |
up vote
0
down vote
I assume you mean uploaded the "enrollments.csv" file to Files section.
This uploads file to the Bucket of Cloud Object Storage service which storage for your project.
You can use project-lib to fetch the file url.
# Import the lib
from project_lib import Project
project = Project(sc,"<ProjectId>", "<ProjectToken>")
# Get the url
url = project.get_file_url("myFile.csv")
For more refer this:-
https://dataplatform.cloud.ibm.com/docs/content/analyze-data/project-lib-python.html
https://dataplatform.cloud.ibm.com/analytics/notebooks/v2/a972effc-394f-4825-af91-874cb165dcfc/view?access_token=ee2bd90bee679afc278cdb23453946a3922c454a6a7037e4bd3c4b0f90eb0924
Thanks, I tried it and read all the links but it did not work. I generated the project ID and token successfully, but the code to get url (url = project.get_file_url('enrollments.csv') gives an error message, that says "ValueError: Something went wrong! error message:ProjectCore__get_file_url(): spark context (sc) is not available. This function can't be invoked!!" I have no idea why, it's more than a bit frustrating I must say. But thanks again.
– Lawrence Krukrubo
Nov 12 at 11:40
add a comment |
up vote
0
down vote
up vote
0
down vote
I assume you mean uploaded the "enrollments.csv" file to Files section.
This uploads file to the Bucket of Cloud Object Storage service which storage for your project.
You can use project-lib to fetch the file url.
# Import the lib
from project_lib import Project
project = Project(sc,"<ProjectId>", "<ProjectToken>")
# Get the url
url = project.get_file_url("myFile.csv")
For more refer this:-
https://dataplatform.cloud.ibm.com/docs/content/analyze-data/project-lib-python.html
https://dataplatform.cloud.ibm.com/analytics/notebooks/v2/a972effc-394f-4825-af91-874cb165dcfc/view?access_token=ee2bd90bee679afc278cdb23453946a3922c454a6a7037e4bd3c4b0f90eb0924
I assume you mean uploaded the "enrollments.csv" file to Files section.
This uploads file to the Bucket of Cloud Object Storage service which storage for your project.
You can use project-lib to fetch the file url.
# Import the lib
from project_lib import Project
project = Project(sc,"<ProjectId>", "<ProjectToken>")
# Get the url
url = project.get_file_url("myFile.csv")
For more refer this:-
https://dataplatform.cloud.ibm.com/docs/content/analyze-data/project-lib-python.html
https://dataplatform.cloud.ibm.com/analytics/notebooks/v2/a972effc-394f-4825-af91-874cb165dcfc/view?access_token=ee2bd90bee679afc278cdb23453946a3922c454a6a7037e4bd3c4b0f90eb0924
answered Nov 10 at 3:13
charles gomes
1,592414
1,592414
Thanks, I tried it and read all the links but it did not work. I generated the project ID and token successfully, but the code to get url (url = project.get_file_url('enrollments.csv') gives an error message, that says "ValueError: Something went wrong! error message:ProjectCore__get_file_url(): spark context (sc) is not available. This function can't be invoked!!" I have no idea why, it's more than a bit frustrating I must say. But thanks again.
– Lawrence Krukrubo
Nov 12 at 11:40
add a comment |
Thanks, I tried it and read all the links but it did not work. I generated the project ID and token successfully, but the code to get url (url = project.get_file_url('enrollments.csv') gives an error message, that says "ValueError: Something went wrong! error message:ProjectCore__get_file_url(): spark context (sc) is not available. This function can't be invoked!!" I have no idea why, it's more than a bit frustrating I must say. But thanks again.
– Lawrence Krukrubo
Nov 12 at 11:40
Thanks, I tried it and read all the links but it did not work. I generated the project ID and token successfully, but the code to get url (url = project.get_file_url('enrollments.csv') gives an error message, that says "ValueError: Something went wrong! error message:ProjectCore__get_file_url(): spark context (sc) is not available. This function can't be invoked!!" I have no idea why, it's more than a bit frustrating I must say. But thanks again.
– Lawrence Krukrubo
Nov 12 at 11:40
Thanks, I tried it and read all the links but it did not work. I generated the project ID and token successfully, but the code to get url (url = project.get_file_url('enrollments.csv') gives an error message, that says "ValueError: Something went wrong! error message:ProjectCore__get_file_url(): spark context (sc) is not available. This function can't be invoked!!" I have no idea why, it's more than a bit frustrating I must say. But thanks again.
– Lawrence Krukrubo
Nov 12 at 11:40
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%2f53224648%2fhow-to-get-the-file-path-to-my-csv-file-in-data-assets-in-watson-studio%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