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

Solution: Sample a data frame

From the course: SQL Server Machine Learning Services: Python

Start my 1-month free trial

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…

Contents