Skip to content
This repository was archived by the owner on Jul 22, 2024. It is now read-only.
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 7 additions & 24 deletions notebooks/WML DB2.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
"metadata": {},
"outputs": [],
"source": [
"!pip install --upgrade ibmos2spark\n",
"!pip install --upgrade watson-machine-learning-client\n",
"\n",
"import numpy as np\n",
Expand All @@ -47,26 +48,7 @@
"metadata": {},
"outputs": [],
"source": [
"\n",
"#PLEASE ENTER YOU OWN CREDENTIALS TO GET DATA FROM DATABASE. \n",
"#CLICK THE 'FILE AND DATA' BUTTON THE TOP RIGHT SIDE OF THE MENU BAR\n",
"\n",
"\n",
"#from ibmdbpy import IdaDataBase, IdaDataFrame\n",
"\n",
"# @hidden_cell\n",
"# This connection object is used to access your data and contains your credentials.\n",
"# You might want to remove those credentials before you share your notebook.\n",
"#idadb_fe06e3df5eef4ac0b1c246b40ed3db6e = IdaDataBase(dsn='DASHDB;Database=BLUDB;Hostname=dashdb-txn-sbox-yp-dal09-03.services.dal.bluemix.net;Port=50000;PROTOCOL=TCPIP;UID=pcl47325;PWD=mwhpp-qlc4wf54s4')\n",
"\n",
"#pd_df = IdaDataFrame(idadb_fe06e3df5eef4ac0b1c246b40ed3db6e, 'PCL47325.HOME_SALES').as_dataframe()\n",
"#pd_df.head()\n",
"\n",
"# You can close the database connection with the following code. Please keep the comment line with the @hidden_cell tag,\n",
"# because the close function displays parts of the credentials.\n",
"# @hidden_cell\n",
"# idadb_fe06e3df5eef4ac0b1c246b40ed3db6e.close()\n",
"# To learn more about the ibmdby package, please read the documentation: http://pythonhosted.org/ibmdbpy/\n"
"# Connect to datasource\n"

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

not sure if you meant to delete the "PLEASE ENTER..." comment. Your readme probably has it covered.

]
},
{
Expand Down Expand Up @@ -523,11 +505,12 @@
"metadata": {},
"outputs": [],
"source": [
"# Replace the credentials that you got from Watson Machine Learning service\n",
"from watson_machine_learning_client import WatsonMachineLearningAPIClient\n",
"wml_credentials = {\n",
" \"apikey\": \"<API KEY>\",\n",
" \"instance_id\": '<INSTANCE ID>',\n",
" \"url\": \"<URL>\"\n",
"wml_credentials = { \n",
" \"apikey\": \"<api key>\",\n",

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is this a regression or you prefer lower?

" \"instance_id\": \"<instance id>\",\n",
" \"url\": \"<URL>\"\n",
"}\n",
"client = WatsonMachineLearningAPIClient(wml_credentials)"
]
Expand Down