Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
380 commits
Select commit Hold shift + click to select a range
56e9eef
dap/dsx-documentation-source/issues/1576
Sep 14, 2018
e5c464a
dap/dsx-documentation-source/issues/1576
Sep 14, 2018
4c8d090
dap/dsx-documentation-source/issues/1576
Sep 14, 2018
e696400
dap/dsx-documentation-source/issues/1576
Sep 14, 2018
7f1f9fe
Upload file
mjmanley Sep 19, 2018
07cd5eb
Merge pull request #1 from IBMDataScience/master
mjmanley Sep 20, 2018
7bf36d3
Delete MELANIEUnderstanding Vehicular Fatalities.ipynb
mjmanley Sep 20, 2018
382fde1
Merge pull request #2 from mjmanley/master
mjmanley Sep 20, 2018
27002cc
dap/dsx-documentation-source/issues/1576
Sep 20, 2018
8f509ec
dap/dsx-documentation-source/issues/783
Sep 20, 2018
cac859e
dap/dsx-documentation-source/issues/1576
Sep 28, 2018
6ea0fe9
dap/dsx-documentation-source/issues/1576
Sep 28, 2018
5821517
dataconnect/tracker/issues/14471
Oct 2, 2018
c30e9a0
dap/dsx-documentation-source/issues/738
Oct 2, 2018
2a9b6e9
test
mjmanley Oct 25, 2018
49d69b2
test file deleted
mjmanley Oct 25, 2018
c92e70e
dap/dsx-documentation-source/issues/1857
Oct 30, 2018
5ca0a3f
OK Lab notebook
mjmanley Nov 9, 2018
930b0c4
Merge branch 'master' of https://github.com/IBMDataScience/sample-not…
mjmanley Nov 9, 2018
e7011d7
dap/dsx-documentation-source/issues/1775
mjmanley Nov 9, 2018
58f3a0c
Images for J. Boyer Quantum notebook
Nov 12, 2018
f277bae
Images for J. Boyer Quantum notebook
Nov 12, 2018
f763a14
dap/dsx-documentation-source/issues/1839
Nov 13, 2018
01f92fc
dap/dsx-documentation-source/issues/1839
Nov 13, 2018
c351a52
dap/dsx-documentation-source/issues/1838
Nov 13, 2018
dde48d0
Fix author information
Nov 15, 2018
ed9de5d
/dap/dsx-documentation-source/issues/1902
Nov 21, 2018
86b57b0
/dap/dsx-documentation-source/issues/1800
Nov 22, 2018
707850e
remove old nav bar
Nov 22, 2018
54c2c84
Add files via upload
wswtizer Nov 22, 2018
a119e4b
dap/dsx-documentation-source/issues/1800
Nov 26, 2018
d704751
dap/dsx-documentation-source/issues/1898
Nov 28, 2018
dcc93bd
dap/dsx-documentation-source/issues/1898
Nov 28, 2018
c674f70
Issue 1898 DO
mjmanley Dec 3, 2018
eba30f3
Issue 1898 DO
mjmanley Dec 3, 2018
8a8f142
Decision Optimization notebooks #1922
mjmanley Dec 5, 2018
ff0263c
dap/dsx-documentation-source/issues/1739
mjmanley Dec 5, 2018
12252a6
dap/dsx-documentation-source/issues/1739
mjmanley Dec 5, 2018
9d69be7
DO issues #1898 #1922
mjmanley Dec 6, 2018
6584c19
Environment name change for DO #1922
mjmanley Dec 7, 2018
7921845
DO Issue #1922
mjmanley Dec 7, 2018
dd80e02
DO issue #1922
mjmanley Dec 7, 2018
244212c
Quantum notebook #1924
mjmanley Dec 11, 2018
ad919a0
Quantum #1924
mjmanley Dec 11, 2018
3a24ced
change request from author
Dec 14, 2018
b538477
typos
Dec 14, 2018
bba3f33
dap/dsx-documentation-source/issues/1977
Dec 19, 2018
30f7dcb
Remove until GA
Dec 20, 2018
c160cf7
dap/dsx-documentation-source/issues/1904
Dec 21, 2018
ae8bb67
dap/dsx-documentation-source/issues/2009
Feb 26, 2019
2b61f14
dap/dsx-documentation-source/issues/2009
Feb 26, 2019
0cf8583
dap/dsx-documentation-source/issues/2009
Feb 26, 2019
52b1e57
dap/dsx-documentation-source/issues/2006
Feb 27, 2019
afc6c58
dap/dsx-documentation-source/issues/2006
Feb 27, 2019
3d747dd
dap/dsx-documentation-source/issues/2006
Feb 27, 2019
b3a39f7
dap/dsx-documentation-source/issues/2005
Feb 27, 2019
8bf45ab
dap/dsx-documentation-source/issues/2005
Feb 27, 2019
b97da38
#2007 WML updates
mjmanley Mar 1, 2019
cc7a4c8
#2007 WML updates
mjmanley Mar 1, 2019
0af4681
#2007 WML changes
mjmanley Mar 1, 2019
2f2da14
#2007 WML changes
mjmanley Mar 1, 2019
4c6a7ea
#2007 WML updates
mjmanley Mar 1, 2019
f8de01b
#2007 WML updates
mjmanley Mar 1, 2019
eef596c
#2007 WML updates again
mjmanley Mar 1, 2019
db07431
#2007 WML
mjmanley Mar 1, 2019
db3d76a
#2007 WML updates
mjmanley Mar 4, 2019
898884c
#2007 WML update
mjmanley Mar 4, 2019
271f74f
#2007 WML updates
mjmanley Mar 4, 2019
9da3269
#2007 WML updates
mjmanley Mar 4, 2019
ab7caab
#2007 WML updates
mjmanley Mar 4, 2019
fa75b8a
#2007 WML changes
mjmanley Mar 4, 2019
e09d61e
#2007 WML
mjmanley Mar 4, 2019
4fcc04d
#2007 WML
mjmanley Mar 4, 2019
4c8b37f
#2007 WML updates
mjmanley Mar 5, 2019
87feccd
#2007 WML updates
mjmanley Mar 5, 2019
b403737
dap/dsx-documentation-source/issues/2061
Mar 5, 2019
2897d9e
#2007 WML updates
mjmanley Mar 6, 2019
01fbb78
#2007 WML updates
mjmanley Mar 6, 2019
73cefda
#2007 WML updates
mjmanley Mar 6, 2019
ae4d6f7
#2007 WML updates
mjmanley Mar 6, 2019
dc561c6
#2007 WML updates
mjmanley Mar 6, 2019
44707b0
#2007 WML updates
mjmanley Mar 6, 2019
8ba3829
#2007 WML updates
mjmanley Mar 6, 2019
cc25efc
#2007 updates
mjmanley Mar 6, 2019
62e1664
#2007 WML updates
mjmanley Mar 6, 2019
9b5e5c2
dap/dsx-documentation-source/issues/2059
Mar 6, 2019
1bcc4b6
#2007 WML updates
mjmanley Mar 7, 2019
900d190
#2007 WML updates
mjmanley Mar 7, 2019
577c7c4
#2007 WML Updates
mjmanley Mar 7, 2019
9b904fe
#2007 WML Updates
mjmanley Mar 7, 2019
4ee3313
#2007 WML updates
mjmanley Mar 7, 2019
a5b4a59
#2007 WML updates
mjmanley Mar 7, 2019
3e26d00
dap/dsx-documentation-source/issues/2033
Mar 7, 2019
9e24c48
dap/dsx-documentation-source/issues/2023
Mar 7, 2019
e721f72
#2007 WML updates
mjmanley Mar 12, 2019
05dd13a
#2007 WML updates
mjmanley Mar 12, 2019
1bad1c8
Delete Use scikit-learn to predict hand-written digits.html
mjmanley Mar 13, 2019
b5aba4f
dap/dsx-documentation-source/issues/2059
Mar 21, 2019
c03cdde
dap/dsx-documentation-source/issues/2059
Mar 21, 2019
7398814
dap/dsx-documentation-source/issues/2059
Mar 21, 2019
7197ff8
dap/dsx-documentation-source/issues/2059
Mar 21, 2019
372653e
dap/dsx-documentation-source/issues/2059
Mar 21, 2019
9a97028
output samle
Mar 21, 2019
30dfc51
updated sample output
Mar 21, 2019
d0e0356
dap/dsx-documentation-source/issues/2059
Mar 22, 2019
1153173
dap/dsx-documentation-source/issues/2059
Mar 22, 2019
1adaaa2
dap/dsx-documentation-source/issues/2080
Mar 25, 2019
f62af51
clean up
Mar 25, 2019
480a147
dap/dsx-documentation-source/issues/2028
Apr 3, 2019
5f59cb3
dap/dsx-documentation-source/issues/2085
Apr 8, 2019
5aaa0fd
dap/dsx-documentation-source/issues/2094
Apr 12, 2019
c5b0495
dap/dsx-documentation-source/issues/2094
Apr 12, 2019
af2ffca
dap/dsx-documentation-source/issues/2085
May 8, 2019
0fa0cd1
dap/dsx-documentation-source/issues/2085
May 8, 2019
5478fef
dap/dsx-documentation-source/issues/2085
May 8, 2019
aaff94e
dap/dsx-documentation-source/issues/2085
May 8, 2019
8d9adf7
dap/dsx-documentation-source/issues/2085
May 8, 2019
e28a67e
dap/dsx-documentation-source/issues/2085
May 8, 2019
38f7c38
dap/dsx-documentation-source/issues/2085
May 8, 2019
869374f
dap/dsx-documentation-source/issues/2085
May 8, 2019
22f1790
dap/dsx-documentation-source/issues/2085
May 8, 2019
8f260b3
dap/dsx-documentation-source/issues/2085
May 8, 2019
a980d5d
dap/dsx-documentation-source/issues/2085
May 8, 2019
ddf43ad
dap/dsx-documentation-source/issues/2085
May 8, 2019
9810bbc
Remove because data set no longer available.
May 8, 2019
83df412
dap/dsx-documentation-source/issues/2007
May 9, 2019
93de519
dap/dsx-documentation-source/issues/2059
May 17, 2019
ae73c9b
dap/dsx-documentation-source/issues/2059
May 17, 2019
49c5ce9
dap/dsx-documentation-source/issues/2085
May 21, 2019
4289a1f
dap/dsx-documentation-source/issues/2085
May 21, 2019
daaa6c0
dap/dsx-documentation-source/issues/2059
May 24, 2019
5251248
dap/dsx-documentation-source/issues/2059
May 24, 2019
a9e1db6
dap/dsx-documentation-source/issues/2059
May 26, 2019
763c334
dap/dsx-documentation-source/issues/2059
May 27, 2019
8417926
dap/dsx-documentation-source/issues/2059
May 27, 2019
74bcc8f
dap/dsx-documentation-source/issues/2059
May 27, 2019
ffb06f7
dap/dsx-documentation-source/issues/2059
May 27, 2019
bcbf98c
dap/dsx-documentation-source/issues/2059
May 27, 2019
6dda854
dap/dsx-documentation-source/issues/2157
Jun 5, 2019
8aef7ec
dap/dsx-documentation-source/issues/2157
Jun 5, 2019
c8cffa9
dap/dsx-documentation-source/issues/2066
Jun 7, 2019
cade52c
file name change
Jun 7, 2019
79c0482
dap/dsx-documentation-source/issues/2157
Jun 10, 2019
91b7d94
dap/dsx-documentation-source/issues/2157
Jun 10, 2019
c6273cf
dap/dsx-documentation-source/issues/2157
Jun 10, 2019
d4b2f1d
dap/dsx-documentation-source/issues/2059
Jun 10, 2019
2ee5629
dap/dsx-documentation-source/issues/2059
Jun 11, 2019
255cfab
dap/dsx-documentation-source/issues/2059
Jun 11, 2019
0d58e25
dap/dsx-documentation-source/issues/2023
Jun 12, 2019
497730f
dap/dsx-documentation-source/issues/2023
Jun 12, 2019
d0cd6e9
dap/dsx-documentation-source/issues/2169
Jun 13, 2019
164d9da
dap/dsx-documentation-source/issues/2169
Jun 14, 2019
064689a
dap/dsx-documentation-source/issues/2168
Jun 21, 2019
9dc4129
dap/dsx-documentation-source/issues/2168
Jun 21, 2019
a8505c8
dsx-documentation-source/issues/2059
Jun 27, 2019
122677b
Fix formatting
Jun 29, 2019
688c1c1
Add blog link
Jun 29, 2019
2f1c2b0
dap/dsx-documentation-source/issues/2059
Jun 29, 2019
9644f54
dap/dsx-documentation-source/issues/2059
Jun 29, 2019
40add85
dap/dsx-documentation-source/issues/2094
Jul 11, 2019
fa68665
Python 3.6 updates
mjmanley Jul 12, 2019
e653b2c
Python 3.6 updates ml-planning/issues/7469
mjmanley Jul 12, 2019
04923d3
delete
mjmanley Jul 12, 2019
634c619
Python 3.6 ml-planning/issues/7469
mjmanley Jul 12, 2019
9a2a8d1
Python 3.6 ml-planning/issues/7469
mjmanley Jul 12, 2019
8f93592
Python 3.6 ml-planning/issues/7469
mjmanley Jul 12, 2019
074a7eb
Python 3.6 ml-planning/issues/7469
mjmanley Jul 12, 2019
3afdbe9
Python 3.6 ml-planning/issues/7469
mjmanley Jul 12, 2019
01efeef
Python 3.6 ml-planning/issues/7469
mjmanley Jul 12, 2019
c692ea4
Python 3.6 ml-planning/issues/7469
mjmanley Jul 12, 2019
3390618
Python 3.6 ml-planning/issues/7469
mjmanley Jul 12, 2019
3c18686
Python 3.6 ml-planning/issues/7469
mjmanley Jul 12, 2019
0fe63f7
Python 3.6 ml-planning/issues/7469
mjmanley Jul 12, 2019
031d11c
Python 3.6 ml-planning/issues/7469
mjmanley Jul 12, 2019
2d2a08c
Python 3.6 ml-planning/issues/7469
mjmanley Jul 12, 2019
76b5171
Python 3.6
mjmanley Jul 12, 2019
e072c4e
Python 3.6 ml-planning/issues/7469
mjmanley Jul 15, 2019
a5a6ca7
Python 3.6 ml-planning/issues/7469
mjmanley Jul 15, 2019
0152201
Python 3.6 ml-planning/issues/7469
mjmanley Jul 15, 2019
be71a9e
Python 3.6 ml-planning/issues/7469
mjmanley Jul 15, 2019
623bda1
Python 3.6 ml-planning/issues/7469
mjmanley Jul 15, 2019
edad63d
Python 3.6 ml-planning/issues/7469
mjmanley Jul 15, 2019
ecdf459
Python 3.6 ml-planning/issues/7469
mjmanley Jul 15, 2019
405dddb
Python 3.6 ml-planning/issues/7469
mjmanley Jul 15, 2019
4535573
Python 3.6 ml-planning/issues/7469
mjmanley Jul 15, 2019
9c7073d
Python 3.6 ml-planning/issues/7469
mjmanley Jul 15, 2019
5647fc0
Python 3.6 ml-planning/issues/7469
mjmanley Jul 15, 2019
3f74712
Python 3.6 ml-planning/issues/7469
mjmanley Jul 15, 2019
8a461cc
Duplicate for ml-planning/issues/7469
mjmanley Jul 15, 2019
b88f44b
Duplicate for ml-planning/issues/7469
mjmanley Jul 15, 2019
2410fe1
Python 3.6 ml-planning/issues/7469
mjmanley Jul 16, 2019
27bfc16
Python 3.6 ml-planning/issues/7469
mjmanley Jul 16, 2019
d81021d
Python 3.6 /ml-planning/issues/7469
mjmanley Jul 16, 2019
4699122
Python 3.6 /ml-planning/issues/7469
mjmanley Jul 16, 2019
5714ed8
Python 3.6 /ml-planning/issues/7469
mjmanley Jul 16, 2019
c402fd4
Python 3.6 /ml-planning/issues/7469
mjmanley Jul 16, 2019
4d0dedf
Python 3.6 /ml-planning/issues/7469
mjmanley Jul 17, 2019
b030204
Python 3.6 /ml-planning/issues/7469
mjmanley Jul 17, 2019
ccbb62f
Python 3.6 /ml-planning/issues/7469
mjmanley Jul 17, 2019
ed47a3c
Python 3.6 /ml-planning/issues/7469
mjmanley Jul 17, 2019
955c529
Python 3.6 ml-planning/issues/7469
mjmanley Jul 19, 2019
3dba3f2
Python 3.6 ml-planning/issues/7469
mjmanley Jul 19, 2019
ef86cdc
NGP-TWC/ml-planning #9537
mjmanley Jul 19, 2019
3f2dd1e
NGP-TWC/ml-planning #9537
mjmanley Jul 19, 2019
25c1ed1
NGP-TWC/ml-planning #9537
mjmanley Jul 19, 2019
2a5435a
NGP-TWC/ml-planning #9537
mjmanley Jul 19, 2019
f4d9720
Python 3.6 ml-planning/issues/7469
mjmanley Jul 19, 2019
4a636a4
Python 3.6 ml-planning/issues/7469
mjmanley Jul 19, 2019
bb6d0d8
dap/dsx-documentation-source/issues/2179
Jul 19, 2019
4523b13
dap/dsx-documentation-source/issues/2061
Jul 19, 2019
2e7a01a
dap/dsx-documentation-source/issues/2061
Jul 19, 2019
a24deba
dap/dsx-documentation-source/issues/2061
Jul 24, 2019
3f50ac0
dap/dsx-documentation-source/issues/2061
wswtizer Jul 24, 2019
cc57b51
dap/dsx-documentation-source/issues/2059
Jul 24, 2019
7f59eec
Merge remote-tracking branch 'origin/master'
Jul 25, 2019
37f53fc
dap/dsx-documentation-source/issues/2059
Jul 25, 2019
9fdf142
dap/dsx-documentation-source/issues/2243
Jul 27, 2019
a32ad0a
dap/dsx-documentation-source/issues/2243
Jul 27, 2019
1be9f2e
dap/dsx-documentation-source/issues/2243
Jul 27, 2019
f114e77
dap/dsx-documentation-source/issues/2243
Jul 27, 2019
43d37b8
dap/dsx-documentation-source/issues/2243
Jul 29, 2019
058d263
dap/dsx-documentation-source/issues/2243
Jul 29, 2019
9d0b10d
NGP-TWC/ml-planning/issues/7469
Jul 29, 2019
06e6182
[NGP-TWC/ml-planning] (#7469)
mjmanley Aug 8, 2019
eec94a3
[NGP-TWC/ml-planning] (#7469)
mjmanley Aug 8, 2019
ff5a1c1
NGP-TWC/ml-planning #7469
mjmanley Aug 9, 2019
0746572
NGP-TWC/ml-planning #7469
mjmanley Aug 9, 2019
f4da116
NGP-TWC/ml-planning #7469
mjmanley Aug 9, 2019
27bea20
delete
mjmanley Aug 9, 2019
db86f6a
ml-planning/issues/7469
mjmanley Aug 9, 2019
f2d81c5
ml-planning/issues/7469
mjmanley Aug 9, 2019
bd10271
Update August 2019
mjmanley Aug 13, 2019
f9240d3
Update August 2019
mjmanley Aug 13, 2019
1c51ef5
Update for #2271
mjmanley Aug 26, 2019
141aa61
Update for #2271
mjmanley Aug 26, 2019
6da1817
updates
mjmanley Aug 26, 2019
bbd3043
updates
mjmanley Aug 26, 2019
3d53953
#9421
mjmanley Sep 4, 2019
f2bdd2f
#9421
mjmanley Sep 4, 2019
70e0b15
#2285
mjmanley Sep 6, 2019
aac2313
#2285
mjmanley Sep 6, 2019
ad24e1e
Wo
mjmanley Sep 12, 2019
7143c36
update link
mjmanley Sep 12, 2019
444a495
dap/dsx-documentation-source/issues/2059
Sep 17, 2019
75fe139
commit
Sep 17, 2019
814fd1b
Merge remote-tracking branch 'origin/master'
Sep 17, 2019
4a18189
Adding readme to desktop folder
Sep 20, 2019
d182901
adding readme
Sep 20, 2019
dca2103
change folder name
Sep 20, 2019
969bff3
Update Readme.md
jforgo Sep 20, 2019
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
13,662 changes: 13,662 additions & 0 deletions Cloud/Archive/Access Db2 Warehouse on Cloud and Db2 with Python.html

Large diffs are not rendered by default.

992 changes: 992 additions & 0 deletions Cloud/Archive/Access Db2 Warehouse on Cloud and Db2 with Python.ipynb

Large diffs are not rendered by default.

12,857 changes: 12,707 additions & 150 deletions Cloud/Archive/Access MySQL with Python.html

Large diffs are not rendered by default.

131 changes: 80 additions & 51 deletions Cloud/IPYNB/Access+MySQL+with+Python.ipynb → Cloud/Archive/Access MySQL with Python.ipynb
100755 → 100644
Original file line number Diff line number Diff line change
@@ -1,5 +1,15 @@
{
"cells": [
{
"cell_type": "markdown",
"metadata": {},
"source": [
"<div style=\"background:#F5F7FA; height:100px; padding: 2em; font-size:14px;\">\n",
"<span style=\"font-size:18px;color:#152935;\">Want to do more?</span><span style=\"border: 1px solid #3d70b2;padding: 15px;float:right;margin-right:40px; color:#3d70b2; \"><a href=\"https://ibm.co/wsnotebooks\" target=\"_blank\" style=\"color: #3d70b2;text-decoration: none;\">Sign Up</a></span><br>\n",
"<span style=\"color:#5A6872;\"> Try out this notebook with your free trial of IBM Watson Studio.</span>\n",
"</div>"
]
},
{
"cell_type": "markdown",
"metadata": {},
Expand All @@ -8,7 +18,7 @@
"\n",
"This notebook shows how to access a MySQL database when using Python.\n",
"\n",
"This notebook runs on Python with Spark 2.0.\n",
"This notebook runs on Python 2 with Spark 2.1.\n",
"\n",
"## Table of contents\n",
"\n",
Expand All @@ -26,9 +36,8 @@
"\n",
"## Setup\n",
"\n",
"Before beginning you will need access to a *MySQL* database. MySQL is an open-source relational database management system (RDBMS) that is widely used as a client–server model RDBMS. To learn more, see the [MySQL website](https://www.mysql.com/).\n",
"\n",
"You should have a MySQL instance installed and running in the cloud. You can use [Amazon RDS (Relational Database Service)](http://aws.amazon.com/rds/mysql/) to set up, operate, and scale a MySQL instance. \n",
"You should have a MySQL instance installed and running in the cloud. MySQL is an open-source relational database management system (RDBMS) that is widely used as a client–server model RDBMS. To learn more, see the [MySQL website](https://www.mysql.com/).\n",
" \n",
"__Note:__ if you are using an Amazon RDS service, make sure it accept connections from every IP.\n",
"\n",
"\n",
Expand All @@ -41,25 +50,15 @@
"cell_type": "code",
"execution_count": 1,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"Requirement already satisfied: MySQL-python in /usr/local/src/bluemix_jupyter_bundle.v52/notebook/lib/python2.7/site-packages\r\n"
]
}
],
"outputs": [],
"source": [
"!pip install MySQL-python --user"
"!pip install -q MySQL-python --user"
]
},
{
"cell_type": "code",
"execution_count": 2,
"metadata": {
"collapsed": true
},
"metadata": {},
"outputs": [],
"source": [
"import MySQLdb"
Expand All @@ -83,28 +82,40 @@
"Connecting to MySQL database requires the following information:\n",
"* Host name or IP address \n",
"* Host port\n",
"* default database name\n",
"* Database name\n",
"* User ID\n",
"* User password\n",
"\n",
"All of this information must be captured in a connection string in a subsequent step. Provide the MySQL connection information as shown:"
]
},
{
"cell_type": "code",
"execution_count": 3,
"metadata": {},
"outputs": [],
"source": [
"#Enter the values for you database connection\n",
"dsn_database = \"\" # for example \"BLUDB\"\n",
"dsn_hostname = \"\" # for example \"mydbinstance.cz6pjylrdjko.us-east-1.rds.amazonaws.com\"\n",
"dsn_port = 3306 # for example 3306 without quotation marks\n",
"dsn_uid = \"\" # for example \"user1\"\n",
"dsn_pwd = \"\" # for example \"7dBZ3jWt9xN6$o0JiX!m\"\n"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## Create the database connection\n",
"Set up a connection as follows. If a connect cannot be made an exception will be raised. \n",
"*conn.cursor* will return a cursor object and you can use this cursor to perform queries:"
"Set up a connection as follows. If a connection cannot be made, an exception will be raised. \n",
"`conn.cursor` will return a cursor object and you can use this cursor to perform queries:"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"collapsed": true
},
"execution_count": 4,
"metadata": {},
"outputs": [],
"source": [
"conn = MySQLdb.connect(host=dsn_hostname, port=dsn_port, user=dsn_uid, passwd=dsn_pwd, db=dsn_database)"
Expand All @@ -123,10 +134,8 @@
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"collapsed": true
},
"execution_count": 5,
"metadata": {},
"outputs": [],
"source": [
"conn.query(\"\"\"DROP TABLE IF EXISTS Cars\"\"\")\n",
Expand All @@ -144,10 +153,8 @@
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"collapsed": true
},
"execution_count": 6,
"metadata": {},
"outputs": [],
"source": [
"conn.query(\"\"\"INSERT INTO Cars VALUES(1,'Audi',52642)\"\"\")\n",
Expand All @@ -171,11 +178,20 @@
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"collapsed": true
},
"outputs": [],
"execution_count": 7,
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"(1L, 'Audi', 52642L)"
]
},
"execution_count": 7,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"cursor=conn.cursor()\n",
"cursor.execute(\"\"\"SELECT * FROM Cars\"\"\")\n",
Expand All @@ -191,13 +207,28 @@
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"collapsed": true
},
"outputs": [],
"execution_count": 8,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"\n",
"Show me the rows from the table:\n",
"\n",
"((2L, 'Mercedes', 57127L),\n",
" (3L, 'Skoda', 9000L),\n",
" (4L, 'Volvo', 29000L),\n",
" (5L, 'Bentley', 350000L),\n",
" (6L, 'Citroen', 21000L),\n",
" (7L, 'Hummer', 41400L),\n",
" (8L, 'Volkswagen', 21600L))\n"
]
}
],
"source": [
"print \"\\nShow me the databases:\\n\"\n",
"print \"\\nShow me the rows from the table:\\n\"\n",
"rows = cursor.fetchall()\n",
"import pprint\n",
"pprint.pprint(rows)"
Expand All @@ -213,10 +244,8 @@
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"collapsed": true
},
"execution_count": 9,
"metadata": {},
"outputs": [],
"source": [
"conn.close()"
Expand All @@ -236,7 +265,7 @@
"metadata": {},
"source": [
"## Want to learn more?\n",
"### Free courses on <a href=\"https://bigdatauniversity.com/courses/?utm_source=tutorial-dashdb-python&utm_medium=github&utm_campaign=bdu/\" rel=\"noopener noreferrer\" target=\"_blank\">Big Data University</a>: <a href=\"https://bigdatauniversity.com/courses/?utm_source=tutorial-dashdb-python&utm_medium=github&utm_campaign=bdu\" rel=\"noopener noreferrer\" target=\"_blank\"><img src = \"https://ibm.box.com/shared/static/xomeu7dacwufkoawbg3owc8wzuezltn6.png\" width=600px> </a>"
"### Free courses on <a href=\"https://bigdatauniversity.com/courses/?utm_source=tutorial-dashdb-python&utm_medium=github&utm_campaign=bdu/\" rel=\"noopener noreferrer\" target=\"_blank\">Cognitive Class</a>: <a href=\"https://bigdatauniversity.com/courses/?utm_source=tutorial-dashdb-python&utm_medium=github&utm_campaign=bdu\" rel=\"noopener noreferrer\" target=\"_blank\"><img src = \"https://ibm.box.com/shared/static/xomeu7dacwufkoawbg3owc8wzuezltn6.png\" width=600px> </a>"
]
},
{
Expand All @@ -254,15 +283,15 @@
"cell_type": "markdown",
"metadata": {},
"source": [
"Copyright © 2016 Big Data University. This notebook and its source code are released under the terms of the <a href=\"https://bigdatauniversity.com/mit-license/\" rel=\"noopener noreferrer\" target=\"_blank\">MIT License</a>."
"Copyright © 2016, 2018 Cognitive Class. This notebook and its source code are released under the terms of the <a href=\"https://bigdatauniversity.com/mit-license/\" rel=\"noopener noreferrer\" target=\"_blank\">MIT License</a>."
]
}
],
"metadata": {
"kernelspec": {
"display_name": "Python 2 with Spark 2.0",
"display_name": "Python 2 with Spark 2.1",
"language": "python",
"name": "python2-spark20"
"name": "python2-spark21"
},
"language_info": {
"codemirror_mode": {
Expand Down
12,203 changes: 12,132 additions & 71 deletions Cloud/Archive/Access+MySQL+with+Python.html
100644 → 100755

Large diffs are not rendered by default.

38 changes: 23 additions & 15 deletions Cloud/Archive/Access+MySQL+with+Python.ipynb
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@
"\n",
"This notebook shows how to access a MySQL database when using Python.\n",
"\n",
"This notebook runs on Python with Spark 2.0.\n",
"\n",
"## Table of contents\n",
"\n",
"1. [Setup](#Setup) \n",
Expand Down Expand Up @@ -37,18 +39,24 @@
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"collapsed": true
},
"outputs": [],
"execution_count": 1,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"Requirement already satisfied: MySQL-python in /usr/local/src/bluemix_jupyter_bundle.v52/notebook/lib/python2.7/site-packages\r\n"
]
}
],
"source": [
"!pip install MySQL-python --user"
]
},
{
"cell_type": "code",
"execution_count": null,
"execution_count": 2,
"metadata": {
"collapsed": true
},
Expand Down Expand Up @@ -95,7 +103,7 @@
"cell_type": "code",
"execution_count": null,
"metadata": {
"collapsed": false
"collapsed": true
},
"outputs": [],
"source": [
Expand All @@ -117,7 +125,7 @@
"cell_type": "code",
"execution_count": null,
"metadata": {
"collapsed": false
"collapsed": true
},
"outputs": [],
"source": [
Expand All @@ -138,7 +146,7 @@
"cell_type": "code",
"execution_count": null,
"metadata": {
"collapsed": false
"collapsed": true
},
"outputs": [],
"source": [
Expand All @@ -165,7 +173,7 @@
"cell_type": "code",
"execution_count": null,
"metadata": {
"collapsed": false
"collapsed": true
},
"outputs": [],
"source": [
Expand All @@ -185,7 +193,7 @@
"cell_type": "code",
"execution_count": null,
"metadata": {
"collapsed": false
"collapsed": true
},
"outputs": [],
"source": [
Expand Down Expand Up @@ -252,9 +260,9 @@
],
"metadata": {
"kernelspec": {
"display_name": "Python 2 with Spark 1.6",
"display_name": "Python 2 with Spark 2.0",
"language": "python",
"name": "python2"
"name": "python2-spark20"
},
"language_info": {
"codemirror_mode": {
Expand All @@ -270,5 +278,5 @@
}
},
"nbformat": 4,
"nbformat_minor": 0
}
"nbformat_minor": 1
}
10 changes: 5 additions & 5 deletions Cloud/Archive/Access+MySQL+with+R.html
Original file line number Diff line number Diff line change
Expand Up @@ -12632,11 +12632,11 @@ <h2 id="Identify-and-enter-the-database-connection-credentials">Identify and ent
<div class="inner_cell">
<div class="input_area">
<div class=" highlight hl-r"><pre><span class="c1">#Enter the values for you database connection</span>
dsn_database <span class="o">=</span> <span class="s">&quot;test_db&quot;</span> <span class="c1"># for example &quot;BLUDB&quot;</span>
dsn_hostname <span class="o">=</span> <span class="s">&quot;bluemix-sandbox-dal-9-portal.0.dblayer.com&quot;</span> <span class="c1"># for example &quot;mydbinstance.cz6pjylrdjko.us-east-1.rds.amazonaws.com&quot;</span>
dsn_port <span class="o">=</span> <span class="m">28416</span> <span class="c1"># for example 3306 without quotation marks</span>
dsn_uid <span class="o">=</span> <span class="s">&quot;admin&quot;</span> <span class="c1"># for example &quot;user1&quot;</span>
dsn_pwd <span class="o">=</span> <span class="s">&quot;JZZKPRKLGGWPUNLL&quot;</span> <span class="c1"># for example &quot;7dBZ3jWt9xN6$o0JiX!m&quot;</span>
dsn_database <span class="o">=</span> <span class="s">&quot; &quot;</span> <span class="c1"># for example &quot;BLUDB&quot;</span>
dsn_hostname <span class="o">=</span> <span class="s">&quot; &quot;</span> <span class="c1"># for example &quot;mydbinstance.cz6pjylrdjko.us-east-1.rds.amazonaws.com&quot;</span>
dsn_port <span class="o">=</span> <span class="c1"># for example 3306 without quotation marks</span>
dsn_uid <span class="o">=</span> <span class="s">&quot; &quot;</span> <span class="c1"># for example &quot;user1&quot;</span>
dsn_pwd <span class="o">=</span> <span class="s">&quot; &quot;</span> <span class="c1"># for example &quot;7dBZ3jWt9xN6$o0JiX!m&quot;</span>
</pre></div>

</div>
Expand Down
10 changes: 5 additions & 5 deletions Cloud/Archive/Access+MySQL+with+R.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -107,11 +107,11 @@
"outputs": [],
"source": [
"#Enter the values for you database connection\n",
"dsn_database = \"test_db\" # for example \"BLUDB\"\n",
"dsn_hostname = \"bluemix-sandbox-dal-9-portal.0.dblayer.com\" # for example \"mydbinstance.cz6pjylrdjko.us-east-1.rds.amazonaws.com\"\n",
"dsn_port = 28416 # for example 3306 without quotation marks\n",
"dsn_uid = \"admin\" # for example \"user1\"\n",
"dsn_pwd = \"JZZKPRKLGGWPUNLL\" # for example \"7dBZ3jWt9xN6$o0JiX!m\""
"dsn_database = \" \" # for example \"BLUDB\"\n",
"dsn_hostname = \" \" # for example \"mydbinstance.cz6pjylrdjko.us-east-1.rds.amazonaws.com\"\n",
"dsn_port = # for example 3306 without quotation marks\n",
"dsn_uid = \" \" # for example \"user1\"\n",
"dsn_pwd = \" \" # for example \"7dBZ3jWt9xN6$o0JiX!m\""
]
},
{
Expand Down
Loading