2015年も本日で最終日となりました。読者の皆様におかれましては、しっかり仕事を納めつつ年末(及び年始)を過ごされていますでしょうか。そんな私も年末は仕事を無事納める事が出来、年末を落ち着いて過ごす傍らで社内で個人的に取り組んでいた可視化事案の仕組みを全面的にPythonで置き換えるという作業をちょいちょい進めておりました。 可視化に関する作業の中にはAmazon Redshiftへのアクセスを行なう部分も含まれていますが、この部分についてもPythonで利用出来るライブラリを使って処理を実現する事が可能です。そこで当エントリではPythonからライブラリ『psycopg2』を使ってAmazon Redshiftへのアクセスを行なう際のサンプルコードをまとめてみたいと思います。(psycopg2はPythonで最もポピュラーなPostgreSQLライブラリです。Amaozn Redshif