Skip to content
Try out AI
  • AI Chat
  • Code
  • Report
  • Speed Up Your Process Using the Workspace AI Assistant

    Discover the power of our AI Assistant. Get started with exciting prompts that will supercharge your data workflow!

    The sample dataset we'll use here consists of orders made with a UK-based online retailer from December 2010 to December 2011. Source of dataset.

    1. Fix errors

    The cell below contains an error. You can press "Fix & Explain" to get your AI Assistant to fix it for you and explain what was wrong with the code.

    this_is_a_variable = 42
    print(this_is_a_variable)

    2. Speed Up Your SQL

    We've connected the below cell to the Employees sample database. Thanks to your AI assistant, you no longer have to write SQL (or Python) yourself.

    You can now

    1. Hover of the cell.
    2. Click on "AI".
    3. Enter your prompt and press the return key.

    If we want to know in which departement the employees earn the most (on average), you can use this prompt:

    List the average salary per departement, from most to least
    Unknown integration
    DataFrameavailable as
    df
    variable
    SELECT d.dept_name, AVG(s.salary) AS average_salary
    FROM employees.departments d
    JOIN employees.dept_emp de ON d.dept_no = de.dept_no
    JOIN employees.salaries s ON de.emp_no = s.emp_no
    GROUP BY d.dept_name
    ORDER BY average_salary DESC;
    This query is taking long to finish...Consider adding a LIMIT clause or switching to Query mode to preview the result.

    3. Let AI help you edit

    The below code cell was generated using the following prompt.

    Can you generate me a leaflet plot pointing to New York?

    You can now use your AI Assistant to edit it

    1. Hover of the next cell.
    2. Click on "AI".
    3. Enter your prompt and press the return key.

    You can for example try this prompt:

    Can you point to London instead?
    import folium
    
    # Create a map centered around London
    map = folium.Map(location=[51.5074, -0.1278], zoom_start=12)
    
    # Add a marker for London
    folium.Marker(location=[51.5074, -0.1278], popup='London').add_to(map)
    
    # Display the map
    map

    4. Automatically Handle All Your Package Imports

    You can also let your AI Assistant create some cells for you.

    1. Hover on the space in between cells and start talking to your AI Assistant by clicking the "plus" icon or the line.
    2. Type in your prompt.
    3. Click on "Ask AI" or press the return key.


    Try this prompt:

    Import the packages I will need to perform a machine learning classification task.
    import pandas as pd
    import numpy as np
    from sklearn.model_selection import train_test_split
    from sklearn.preprocessing import StandardScaler
    from sklearn.linear_model import LogisticRegression
    from sklearn.metrics import accuracy_score, confusion_matrix

    5. Build Beautiful Visualizations

    You can use your AI Assistant to create visualizations for you.

    Try this Prompt:

    Create a Plotly plot of monthly sales in 2011 based on online_retail.csv.

    6. Create a Plotly plot of monthly sales

    To create a Plotly plot of monthly sales in 2011 based on the online_retail.csv dataset, we can follow these steps:

    1. Load the dataset
    2. Preprocess the data
    3. Group the data by month
    4. Calculate the total sales for each month
    5. Create a Plotly plot

    Let's start by loading the dataset.

    import pandas as pd
    import plotly.express as px
    
    # Load the dataset
    df = pd.read_csv('online_retail.csv')
    
    # Display the first few rows of the dataset
    df.head()
    # Preprocess the data
    
    # Drop rows with missing values
    df.dropna(inplace=True)
    
    # Convert InvoiceDate column to datetime
    df['InvoiceDate'] = pd.to_datetime(df['InvoiceDate'])
    
    # Extract year and month from InvoiceDate
    df['Year'] = df['InvoiceDate'].dt.year
    df['Month'] = df['InvoiceDate'].dt.month
    
    # Calculate total sales
    df['TotalSales'] = df['Quantity'] * df['UnitPrice']
    
    # Display the preprocessed data
    df.head()
    
    # Calculate the total sales for each month
    
    df_grouped = df.groupby(['Year', 'Month']).sum().reset_index()
    
    df_grouped.head()
    import plotly.express as px
    
    # Create a scatter plot
    fig = px.scatter(df_grouped, x='Month', y='TotalSales', color='Year', title='Total Sales by Month')
    
    # Show the plot
    fig.show()