From the course: Introduction to Spark SQL and DataFrames
Unlock the full course today
Join today to access over 24,800 courses taught by industry experts.
Save data from DataFrames
From the course: Introduction to Spark SQL and DataFrames
Save data from DataFrames
- [Instructor] Now sometimes after we've been working with DataFrames, and creating new DataFrames, and running calculations, and doing sampling and so forth, we might want to save our results out. It's very simple way to do that. Now, here, I've started with a DataFrame already loaded, df1 has our location temperature data. If I want to save that out, I can simply specify the name of the DataFrame, that's df1, and then use the write method and specify the csv method within that, and then specify a name for what I'd like to save. In this case, it's df1.csv. And I'll execute that. So what that's done is it has saved the DataFrame out to disk using the csv format. So let's take a look at the directory. So, to execute a shell command from within the Jupyter notebook, you can use the exclamation mark, and that basically tells Jupyter notebook, everything that's going to follow is basically a shell command. So I can do…
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.
Contents
-
-
-
-
-
(Locked)
Set up a Jupyter notebook2m 1s
-
(Locked)
Load data into DataFrames: CSV Files7m 26s
-
(Locked)
Load data into DataFrames: JSON Files3m 16s
-
(Locked)
Basic DataFrame operations3m 26s
-
(Locked)
Filter data with DataFrame API2m 13s
-
(Locked)
Aggregate data with DataFrame API3m 47s
-
(Locked)
Sample data from DataFrames5m 25s
-
(Locked)
Save data from DataFrames3m 27s
-
(Locked)
-
-
-