From the course: SQL Server Machine Learning Services: Python
Unlock the full course today
Join today to access over 22,600 courses taught by industry experts or purchase this course individually.
Solution: Sample a data frame
From the course: SQL Server Machine Learning Services: Python
Solution: Sample a data frame
(bouncy music) - [Instructor] I hope you were 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 Control F or Command F on your keyboard. So I'll search for random sample. It 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 data frame. So let's go ahead and click on this link to get to documentation. At the very top we have an example of what it looks like, so we have DataFrame.sample. In this case, data frame is just a placeholder for the name of the data frame, so DataFrame.sample. Inside a parenthesis, we have a series of parameters. Now, in most documentation, you will have a list of what…
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 data frame1m 12s
-
(Locked)
Solution: Sample a data frame5m 21s
-
(Locked)
-
-
-
-