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.
Slice a data frame to series
From the course: SQL Server Machine Learning Services: Python
Slice a data frame to series
- [Instructor] When we bring data in from SQL server through the input data one parameter, it imports a data frame. In order to work with the values in Python, it might be useful to break that data frame into individual series, one series from each column in the input dataset. Let's take a look at how to do this by importing some data. I've got a select statement here. It says SELECT TOP 10 CityID and city name columns from the Application.Cities table. It's going to highlight all of that and execute it so we can see our starting data. And this is the data that I'm importing into my Python script. So right now we're going to have a data frame called InputDataSet that has two columns. To break them into individual columns, we can make reference to their column indexes. Just like with row indexing that starts with zero to represent the first row in the data frame, column index zero represents the first column in the data frame. So to split up these two columns, we want to separate…
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)
Return values with indexes and series6m 8s
-
(Locked)
Convert a series to a data frame4m 40s
-
(Locked)
Add multiple series to a data frame3m 12s
-
(Locked)
Include the index in a data frame4m 44s
-
(Locked)
Slice a data frame to series4m 23s
-
(Locked)
Challenge: Import and process data52s
-
(Locked)
Solution: Import and process data6m 44s
-
(Locked)
-
-
-