From the course: Complete Guide to Advanced SQL Server
Unlock the full course today
Join today to access over 24,700 courses taught by industry experts.
Solution: Sample a DataFrame - SQL Server Tutorial
From the course: Complete Guide to Advanced SQL Server
Solution: Sample a DataFrame
I hope you are able to use what you've seen and apply that knowledge to a new problem. Let's walk through the solution together. I asked you to return a random sampling of records, so I'm going to first search through the documentation page for random sample. In most web browsers, you can pull up a search box by typing in Ctrl+F or command F on your keyboard. So I'll search for a random sample. That has one hit on the page, and it's for this function DataFrame.sample. And it says that it returns a random sample of items from an axis of object. And in our case that just means from a DataFrame. So let's go ahead and click on this link to get to the documentation. At the very top, we have an example of what it looks like. So we have DataFrame.sample. In this case, DataFrame is just a placeholder for the name of the DataFrame, so DataFrame.sample. Inside of parentheses, we have a series of parameters. Now, in most documentation, you'll have a list of what the parameters are down below…
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)
The Anaconda open-source packages7m 27s
-
(Locked)
Functions in the revoscalepy package1m 48s
-
(Locked)
Model, train, and score with microsoftml1m 16s
-
(Locked)
Produce graphics with Matplotlib7m 53s
-
(Locked)
Get descriptive statistics with pandas7m 45s
-
(Locked)
Challenge: Sample a DataFrame1m 12s
-
(Locked)
Solution: Sample a DataFrame5m 21s
-
(Locked)
-
-
-
-
-