LoginSignup
0
1

More than 5 years have passed since last update.

JupyterからPostgresに接続する

Last updated at Posted at 2019-02-23

環境

・Windows 10
・Anaconda 
・psycopg2 2.7
・Jupyter

前提

前提としてPostgresのインスト―ル、テーブル作成、データ投入は終わっているものとします。
また、AnacondaやJupyterのインストールも終わっているものとします。

SQLをとにかく実行する

アプリケーション同様、Postgres関連のモジュールをインポートし、カーソルを用意して
SQLを実行するだけ。

image.png

SQLを実行してPandasのDataFrameに読み込む

pandasのread_sqlメソッドにsqlとconnectionを与えるだけ。

image.png

0
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
1