From the course: Data Science on Google Cloud Platform: Exploratory Data Analytics
Unlock the full course today
Join today to access over 22,600 courses taught by industry experts or purchase this course individually.
Writing results to Cloud Storage - Google Cloud Tutorial
From the course: Data Science on Google Cloud Platform: Exploratory Data Analytics
Writing results to Cloud Storage
- [Instructor] When all data exploration is done, the results are usually returned back to some persistent storage for later use. In this example, we are going to write the conversion ratio by discount percent into a CSV file in Cloud Storage. To do that, we first convert the data frame into a CSV string by using the StringIO function. We then print the contents of the CSV string variable to check its content. We then use the Cloud Storage command line API to write the contents of the CSV string variable into an object in Cloud Storage. Once the strip is done, we can go to Cloud Storage Browser and check to see if the object we have returned has been successfully created. As you can see, the file is created here with the intended contents. This is a simple example of doing end-to-end exploratory data analysis on Datalab.
Practice while you learn with exercise files
Download the files the instructor uses to teach the course. Follow along and learn by watching, listening and practicing.