1
00:00:01,170 --> 00:00:07,320
Hi, welcome back in this video, you're going to solely define the skills to retrieve data from as

2
00:00:07,830 --> 00:00:14,280
by looking at a real world example of converting actual data into C as V.

3
00:00:14,640 --> 00:00:19,470
So we're going to work on the same database file, which we worked in the previous video.

4
00:00:20,250 --> 00:00:23,850
So that is how it looks like the table of that database file.

5
00:00:24,240 --> 00:00:31,470
So basically, what it will do is we will have these data just as you see them in here, we will have

6
00:00:31,470 --> 00:00:34,050
them inside a see as we file.

7
00:00:34,260 --> 00:00:37,530
So three columns, nine arrows in a CAC file.

8
00:00:37,770 --> 00:00:38,490
Let's do this.

9
00:00:39,720 --> 00:00:44,400
We import excu three and we establish a connection to the database.

10
00:00:44,400 --> 00:00:46,020
We create a cursor object.

11
00:00:47,850 --> 00:00:53,810
And then for this, this comes in handy.

12
00:00:53,820 --> 00:00:56,540
So Panzers is a data analysis library.

13
00:00:56,550 --> 00:01:03,600
It allows you to manipulate CAC files, excel files and all the tabular data formats.

14
00:01:04,530 --> 00:01:12,990
Once you import pandas, then we don't execute the query through CUR, as we did previously.

15
00:01:13,200 --> 00:01:14,250
So could execute.

16
00:01:14,250 --> 00:01:24,120
This is what we did, but we executed through Panthers' that reads as SQL query methods.

17
00:01:24,120 --> 00:01:28,620
So Pando says this method, which gets as inputs a string.

18
00:01:31,160 --> 00:01:33,500
And that is the escrow query.

19
00:01:34,070 --> 00:01:41,840
So basically, we want to create a pandas dataframe out or out of the results orphanage school query.

20
00:01:42,500 --> 00:01:54,020
So this girl query will be select everything from a peace order, perhaps if you like, that's optional.

21
00:01:54,440 --> 00:02:07,880
So order by a is an wasik query, and then you need to pass another parameter that is the connection

22
00:02:07,880 --> 00:02:08,419
object.

23
00:02:08,419 --> 00:02:15,800
So you want to specify which database connection this query should run in.

24
00:02:17,060 --> 00:02:25,760
No, so that will give us the data stored in a pandas data frame object before we put that data frame

25
00:02:25,760 --> 00:02:27,020
into a series file.

26
00:02:27,380 --> 00:02:28,600
Let's first print it out.

27
00:02:32,660 --> 00:02:37,010
Pandas will be installed because it's a third party, the library.

28
00:02:47,640 --> 00:02:51,720
And once panels is installed, we gather data from green adults.

29
00:02:51,990 --> 00:02:54,240
So that's a pandas dataframe object.

30
00:02:55,300 --> 00:02:57,730
This is not a list of troubles.

31
00:02:59,590 --> 00:03:04,450
So now we are outside of ask you, well, we have a data frame.

32
00:03:04,450 --> 00:03:09,280
We can apply the F to C as V.

33
00:03:09,280 --> 00:03:17,980
So D F is the variable to see as we use a method which gets as inputs, a file path of the C as V you

34
00:03:17,980 --> 00:03:19,150
want to create.

35
00:03:19,630 --> 00:03:30,700
Let's call this database the C as V and you want to set index equal to none because you don't want this

36
00:03:30,940 --> 00:03:31,570
first.

37
00:03:33,200 --> 00:03:41,600
Column stories in the 6V, if you want that, then remove that parameter, that argument, so that we

38
00:03:41,600 --> 00:03:48,290
will remove that and execute once the codes runs.

39
00:03:48,320 --> 00:03:52,520
You should see a database that a file in your project directory.

40
00:03:53,000 --> 00:03:55,520
Now this is a Dot C as V format.

41
00:03:55,730 --> 00:03:59,570
If you want an Excel file, instead, you'd want to.

42
00:04:00,970 --> 00:04:02,020
Replays that.

43
00:04:04,540 --> 00:04:06,550
With to excel.

44
00:04:09,300 --> 00:04:18,149
And change the extension X as X, and I'm going to comment this out the first one.

45
00:04:19,950 --> 00:04:30,270
If you were wrong this, you're going to get an error because pandas needs these open p y excel dependency.

46
00:04:30,280 --> 00:04:33,960
So goats of a shell and say pip install.

47
00:04:36,710 --> 00:04:45,830
Open P y excel to install that library and then run the code again.

48
00:04:47,570 --> 00:04:51,560
And you should see the database that excel Xl6 file.

49
00:04:52,400 --> 00:04:58,790
So if you download that file and you open it with Excel or another program that reads spreadsheets,

50
00:04:59,090 --> 00:05:01,220
then you should see the same data.

51
00:05:02,970 --> 00:05:11,250
So that is how to convert S-curve data from the database and get them in to see us v or Excel files.

52
00:05:12,210 --> 00:05:13,500
Thank you, and I'll talk to you later.

