|
26 | 26 | "metadata": {}, |
27 | 27 | "outputs": [], |
28 | 28 | "source": [ |
| 29 | + "!pip install --upgrade ibmos2spark\n", |
29 | 30 | "!pip install --upgrade watson-machine-learning-client\n", |
30 | 31 | "\n", |
31 | 32 | "import numpy as np\n", |
|
47 | 48 | "metadata": {}, |
48 | 49 | "outputs": [], |
49 | 50 | "source": [ |
50 | | - "\n", |
51 | | - "#PLEASE ENTER YOU OWN CREDENTIALS TO GET DATA FROM DATABASE. \n", |
52 | | - "#CLICK THE 'FILE AND DATA' BUTTON THE TOP RIGHT SIDE OF THE MENU BAR\n", |
53 | | - "\n", |
54 | | - "\n", |
55 | | - "#from ibmdbpy import IdaDataBase, IdaDataFrame\n", |
56 | | - "\n", |
57 | | - "# @hidden_cell\n", |
58 | | - "# This connection object is used to access your data and contains your credentials.\n", |
59 | | - "# You might want to remove those credentials before you share your notebook.\n", |
60 | | - "#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", |
61 | | - "\n", |
62 | | - "#pd_df = IdaDataFrame(idadb_fe06e3df5eef4ac0b1c246b40ed3db6e, 'PCL47325.HOME_SALES').as_dataframe()\n", |
63 | | - "#pd_df.head()\n", |
64 | | - "\n", |
65 | | - "# You can close the database connection with the following code. Please keep the comment line with the @hidden_cell tag,\n", |
66 | | - "# because the close function displays parts of the credentials.\n", |
67 | | - "# @hidden_cell\n", |
68 | | - "# idadb_fe06e3df5eef4ac0b1c246b40ed3db6e.close()\n", |
69 | | - "# To learn more about the ibmdby package, please read the documentation: http://pythonhosted.org/ibmdbpy/\n" |
| 51 | + "# Connect to datasource\n" |
70 | 52 | ] |
71 | 53 | }, |
72 | 54 | { |
|
523 | 505 | "metadata": {}, |
524 | 506 | "outputs": [], |
525 | 507 | "source": [ |
| 508 | + "# Replace the credentials that you got from Watson Machine Learning service\n", |
526 | 509 | "from watson_machine_learning_client import WatsonMachineLearningAPIClient\n", |
527 | | - "wml_credentials = {\n", |
528 | | - " \"apikey\": \"<API KEY>\",\n", |
529 | | - " \"instance_id\": '<INSTANCE ID>',\n", |
530 | | - " \"url\": \"<URL>\"\n", |
| 510 | + "wml_credentials = {\n", |
| 511 | + " \"apikey\": \"<api key>\",\n", |
| 512 | + " \"instance_id\": \"<instance id>\",\n", |
| 513 | + " \"url\": \"<URL>\"\n", |
531 | 514 | "}\n", |
532 | 515 | "client = WatsonMachineLearningAPIClient(wml_credentials)" |
533 | 516 | ] |
|
0 commit comments