Hello,
I completed the winpython 3.3.1.0 default installation to integrate sql in my portable winpython directory.
Procedure :
- install winpython3.3.1.0 somewhere (with no "$" in the directory path, for "pip" to work correctly),
- launch "WinPython Command Prompt.exe" a first time,
- from the opened DOS window , install "SQLAlchemy" and "ipython-sql" with this 2 commands :
pip install SQLAlchemy
pip install ipython-sql
- then, launch ipython a first time :
ipython3 notebook --pylab inline
(your favorite navigator should be recent : firefox, chrome, or internet_explorer10)
- from the ipython notebook install from the web the mathjax library :
from IPython.external import mathjax; mathjax.install_mathjax()
- and now, this notebook should be possible, on every pc you copy you your winpython directory :
#this is from
http://catherinedevlin.blogspot.fr examples of using sql-ipython
import pandas as pd
%load_ext sql
%%sql sqlite://
CREATE TABLE writer (first_name, last_name, year_of_death);
INSERT INTO writer VALUES ('William', 'Shakespeare', 1616);
INSERT INTO writer VALUES ('Bertold', 'Brecht', 1956);
SELECT * FROM writer
#getting those SQL query datas in python
#results[:] = query datas uploaded, results.keys[:] = columns of sql query
results = %sql SELECT * FROM writer
#combining sql query and pandas
df=pd.DataFrame(results, columns=results.keys[:])
df