Search
 
SCRIPT & CODE EXAMPLE
 

PYTHON

how to save query data into dataframe pscopg2

import pandas as pd
import pandas.io.sql as sqlio
import psycopg2

conn = psycopg2.connect("host='{}' port={} dbname='{}' user={} password={}".format(host, port, dbname, username, pwd))
sql = "select count(*) from table;"
dat = sqlio.read_sql_query(sql, conn)
conn = None
Comment

PREVIOUS NEXT
Code Example
Python :: hbox(children=(floatprogress(value= 
Python :: opencv get area of contour 
Python :: python get all folders in directory 
Python :: save image requests python 
Python :: check python version ubuntu 
Python :: pandas remove row if missing value in column 
Python :: knn sklearn 
Python :: delete image with python 
Python :: add sheet to existing workbook openpyxl 
Python :: python sleep milliseconds 
Python :: inverse matrix numpy 
Python :: genspider scrapy 
Python :: fill missing values in column pandas with mean 
Python :: filter list with python 
Python :: squared sum of all elements in list python 
Python :: pip install apache beam gcp 
Python :: remove comma from string python column 
Python :: how to load ui file in pyqt5 
Python :: create dataframe pyspark 
Python :: python flatten dict 
Python :: install library from python code 
Python :: confusion matrix seaborn 
Python :: subplot matplotlib set limits 
Python :: python ffmpeg 
Python :: python check if hotkey pressed 
Python :: remove negative numbers from list python 
Python :: isinstance numpy array 
Python :: triangle pygame 
Python :: pandas reciprocal 
Python :: how to convert kg to g using python 
ADD CONTENT
Topic
Content
Source link
Name
6+5 =