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.
Include the index in a DataFrame - SQL Server Tutorial
From the course: Complete Guide to Advanced SQL Server
Include the index in a DataFrame
The index that Python uses can sometimes be useful to include when you send your DataFrame to a SQL result set, but since it isn't normally part of the data, it gets lost in the translation. Let's take a look at what I mean. I'm going to start out with our standard blank template here. And this time we're going to make use of the input_data_1 parameter. So I'll type in a comma @ input_data_1. And we're going to pull some information out of the Application.Cities table. I'm going to select the latest recorded population. That'll pull just a single column from this table. And if I just want to check on the SELECT statement make sure it works right, I can highlight this text and press "Execute." And that'll run just the SELECT statement. And that's the data there. Now, I'm going to go up here into my script, and I'm going to take the OutputDataSet and assign it the value of the InputDataSet. This will just pass the data straight through. We're not going to modify it in any way. And I can…
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 DataFrame4m 40s
-
(Locked)
Add multiple series to a DataFrame3m 12s
-
(Locked)
Include the index in a DataFrame4m 44s
-
(Locked)
Slice a DataFrame to series4m 23s
-
(Locked)
Challenge: Import and process data52s
-
(Locked)
Solution: Import and process data6m 44s
-
(Locked)
-
-
-
-