# -------------------------------------------------------------------------------- NOTEBOOK-CELL: CODE # import libraries: # dataiku to interact with dataiku API # pandas and numpy are default # seaborn for plotting # os to join paths import dataiku import pandas as pd, numpy as np import seaborn as sns import os from dataiku import pandasutils as pdu # -------------------------------------------------------------------------------- NOTEBOOK-CELL: CODE # connect to the dataset using the dataiku API iris_handle = dataiku.Dataset("iris_copy") iris_df = iris_handle.get_dataframe() # -------------------------------------------------------------------------------- NOTEBOOK-CELL: CODE # connect to the folder in which we want to store the plots # get the path to the folder with the get_path() method # note that this will overwrite the previous version of the plot file # if you don't want to overwrite, make the name dynamic by adding e.g. the current time to the file name plot_folder_handle = dataiku.Folder("2qmGlaPX") plot_folder_path = plot_folder_handle.get_path() plot_path = os.path.join(plot_folder_path, 'iris_scatter.png') # -------------------------------------------------------------------------------- NOTEBOOK-CELL: CODE # create the plot and store it as a python object # use the savefig method to save the plot iris_pairplot = sns.pairplot(iris_df[['sepal_width', 'sepal_length', 'variety']], hue = 'variety') iris_pairplot.savefig(plot_path)