Hi, welcome back.
In this video, you will learn how to use Python to save the important data from the script data from
our website as a table and a database and query that table.
So let's begin.
First step is to open the vision admin for user interface and create a new database called Programming
as a click on the servers dropdown, then possibly dropdown, then choose, create, then choose a database.
Then in general tab we add our database name and programming, then in definition tab and for template
we will choose 10 zeros, then click save to save database we have just created right.
Click on database and choose refresh.
This will activate our new database programming.
Now we will open our ACMD and Windows or terminal in Mac OS to run and jump in our lab at the following
Jobster Space Lab and enter.
This will open our job at our lab as the following and the first cell as we learn before we will import
our python module that we will use in our project as the following.
Import psychobilly to as Biju, to then import Banda's as b'day in the second line and run the cell.
Then we will assign that variable to data that Banda's will read from HTML five of the specified Web
page in the HTML read method of the painter's module.
As we said before, the panda's return data and the XML file of the web page as Python lists.
So we will choose the important information of this data and assign it to a data frame called D.F.,
for example, as the following def equal data between two square brackets zero.
Then we will print this D.F. data frame by typing D.F. NSL, then run that cell.
We observe that there are columns, names needed to be cleaned, so we will use the name method as the
following to clean those columns names and make it easy for Python to save it as columns in a table
in the database programming we have just created.
So our code will be as the following def equals def Dautry name between two brackets column equal between
to carry brackets.
The names of the columns that we want to rename as the following between two parentheses popularity
unique visitors per month one column then between two parentheses the new name we want to rename our
column Enter and so on for the other columns we want to rename.
You can also rename the Our Case column into lowercase column, but it is not important because PostgreSQL
Equal is not the case.
Since then, we will declare our connection.
So assign können variable equal bije dot connect and between two brackets the host is localhost between
two double parentheses and support my board.
That name programming between two double parenthesis and use are between two entities, in my case both
degrees and my best words between two double parentheses and so on the run zisser to make the connection.
Then we will import important module for our project as the following from Esequiel Alchemy Import Create.
And so we will use create engine from execute alchemy module to create our new table called Babbler
Language as the following engine Ekwall create engine between two brackets and two parentheses both
degrees equal plus psychobilly two column.
Slash, slash, possibly then column, then my password at localhost, then Collum, then my budget
slash programming, then closes apprentice's and close the brackets, then a new line.
We want to save the table.
We have just created to our database programming as the following, using data frame dot to sexual order
to ask you all method.
So the f dot to underscore Ezekial between two brackets and two parentheses.
The first item Babulal underscore language comma engine comma f exist equal append comma and X equal
fold.
So our table babbler underscore language will be created by Engin which will search if exists and created
by Eskil Alchemy.
And we don't need to add and next to our new table babbler underscore language and run the self.
At this moment we were written to be admin for to check our database programming and our new table created
as the following.
We will refresh database dropdown, then Orbin programming database, then a scheme, then public,
then tables.
So we will find the new table babbler underscore language.
Now we will queries a new table as the following select abstracts from Babulal underscore language,
then run the query and return in six columns and thirteen rows which affected by our query and the same
data in our data frame will be return it.
At this point we reach the end of this lecture.
Hope you enjoyed this lecture and get all of that.
Thanks for being here.
Thanks for watching.
See you next with you.