We would be getting data from different sources for doing data analysis. Most common being from files, we might even source from databases.
import psycopg2 as pg import pandas.io.sql as psql # get connected to the database connection = pg.connect("dbname=mydatabase user=postgres") dataframe = psql.frame_query("SELECT id, price FROM stock_price", connection)
Make sure the packages are installed.
This simple snippet would come handy at times.