Pandas SQL - How to read data from a microsoft sql database

Learn Pandas
Learn Pandas
49.3 هزار بار بازدید - 10 سال پیش - Reading data into pandas from
Reading data into pandas from a sql server database is very important. If you plan on working for a company you HAVE TO know how to use Pandas and SQL. This video will show you how.

What is Pandas? A Python data analysis library

Most big companies either use Microsoft or Oracle for their RDBMS (relational database management system). There are others like mysql but if you learn these two, you should be covered in most cases. This video will concentrate on getting data out of a Microsoft database.

We first connect to sql server and then open the database called BizIntel. This is where you will find a table called "data". Note this is all made up data created for the purposes of this tutorial.

The table contains three columns:  Date, Symbol, and Volume
This table simulates stock prices and their volume on a specific date.

We then turn to the Jupyter notebook and start to import SQL specific Python libraries like PyODBC. We then proceed with explaining code on how to connect to your local mssql (microsoft sql server) instance via Pandas and PyODBC. This is how we go to pandas from sql.

We finally generate the sql statement for pandas and read in the data. This is a very basic example and we did not have to supply the odbc connection any passwords. We also did not have to worry about changing any of the datatypes of our dataframe as they were imported into pandas without any issues.  

🔥 Free Pandas Course: https://hedaro.gumroad.com/l/tqqfq
10 سال پیش در تاریخ 1393/09/03 منتشر شده است.
49,336 بـار بازدید شده
... بیشتر