I have scored some data in a R notebook and used the write.csv method to create a CSV file of the scored data stored in a data frame. What is the best way to retrieve this file on DSX ?
-
what is `DSX` ? – mtoto Mar 31 '17 at 17:43
-
Have a look at the result of `getwd()` – jogo Mar 31 '17 at 17:47
-
1DSX is Data Science Experience. See the tag. – Roland Weber Apr 03 '17 at 05:26
2 Answers
The easiest way to get data out of Data Science Experience (DSX), is to write it to object storage.
For R specifically, there are a couple options for getting data into object storage:
- objectStoreR - is a simple R package we wrote to make it easy to get or put data in your object storage container. The readme should give enough code to get started. If you are missing any functionality leave us a Github issue.
- ibmos2spark - is another option that is specifically designed to help with object storage i/o working with Spark objects
If you are using Python, I'd recommend checking out my blog on this topic.
Once you have the data in your object storage container, navigate to "Object Storage" under the main navigation on the left. This will list all the containers in your object storage service, find the one associated with your project, then you can select the file and download it as one of the actions available.

- 86
- 2
When you write to the file system, you can work with the file on the server. For example in a Python notebook, you can use !ls
to list files, or !cat <filename>
to look at the content. But we currently have no easy way to transfer files from the server to your workstation. I therefore agree with Greg Filla's answer that writing to Object Storage instead of the file system is the best way to make your results downloadable.
Nevertheless, if your file is small and formatting isn't critical, you could use !cat <filename>
and copy the output from the notebook into a text editor. For binary files, or when formatting is critical, I've also used !base64 <filename>
in the notebook for encoding and base64 -d
on the workstation for decoding a file. But it's cumbersome.

- 1,865
- 2
- 17
- 27