Try it out

Once your notebook has been instantiated, you are ready to run Python commands and code. Take notice of a couple of things in the following screenshot. For example, we have entered a snip of Python code in the first cell of the notebook that iterates with a for loop and prints columns of data. The other thing to notice is that we have clicked on Find and add data and added a new file (winemag-data-130k-v2.csv) as an asset, as shown in the following screenshot:

To make things easy, we can click on the link below the file name Insert to code and select Insert pandas DataFrame. The result is that the appropriate Python modules (pandas is a software library written for the Python programming language for data manipulation and analysis) are imported for us and a Python DataFrame is automatically defined. This is shown in the notebook cell (In [9]) in the following screenshot:

The output generated by the last line of code, df_data_1.head() is displayed in the notebook cell Out [9]:

Now we have a data asset (a CVS file) loaded and accessible in our Watson Studio project via a DataFrame object.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset