Try out AI
  • AI Chat
  • Code
  • Report
  • Beta
    Spinner

    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.
    import folium
    
    # Create a map centered around New York
    ny_map = folium.Map(location=[40.7128, -74.0060], zoom_start=12)
    
    # Add a marker at the location of New York
    folium.Marker(location=[40.7128, -74.0060], popup='New York').add_to(ny_map)
    
    # Display the map
    ny_map

    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 New York
    map = folium.Map(location=[40.7128, -74.0060], zoom_start=12)
    
    # Add a marker for New York
    folium.Marker(location=[40.7128, -74.0060], popup='New York').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.

    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.
    import pandas as pd
    import plotly.express as px
    
    # Read the data from online_retail.csv
    df = pd.read_csv('online_retail.csv')
    
    # Convert the 'InvoiceDate' column to datetime
    df['InvoiceDate'] = pd.to_datetime(df['InvoiceDate'])
    
    # Filter the data for the year 2011
    df_2011 = df[df['InvoiceDate'].dt.year == 2011]
    
    # Group the data by month and calculate the total sales
    monthly_sales = df_2011.groupby(df_2011['InvoiceDate'].dt.month)['Quantity'].sum().reset_index()
    
    # Create the Plotly plot
    fig = px.bar(monthly_sales, x='InvoiceDate', y='Quantity', labels={'InvoiceDate': 'Month', 'Quantity': 'Sales'})
    
    # Show the plot
    fig.show()

    What else will you do with it?

    It's up to you now! How will you use your new AI Assistant?

    Looking for more prompts to try? The following tutorial has more: 10 Ways to Speed Up Your Analysis With the Workspace AI Assistant

    Looking for more datasets to explore? We have a bunch of datasets your new AI Assistant will love to explore!

    Unknown integration
    DataFrameavailable as
    df1
    variable
    SELECT *
    FROM employees.departments d
    JOIN employees.dept_emp de ON d.dept_no = de.dept_no
    JOIN employees.dept_manager dm ON d.dept_no = dm.dept_no
    JOIN employees.employees e ON de.emp_no = e.emp_no
    JOIN employees.salaries s ON e.emp_no = s.emp_no
    JOIN employees.titles t ON e.emp_no = t.emp_no
    LIMIT 1000;
    This query is taking long to finish...Consider adding a LIMIT clause or switching to Query mode to preview the result.
    import pandas as pd
    import numpy as np
    
    # Create a list of names
    names = ['John', 'Emma', 'Michael', 'Sophia', 'William', 'Olivia', 'James', 'Ava', 'Benjamin', 'Isabella']
    
    # Create a list of ages
    ages = np.random.randint(18, 25, size=len(names))  # Fix: Use len(names) instead of 100
    
    # Create a list of scores for subjects
    subjects = ['Math', 'Science', 'English', 'History']
    scores = np.random.randint(60, 100, size=(len(names), len(subjects)))  # Fix: Use len(names) instead of 100
    
    # Create the DataFrame
    students = pd.DataFrame({'name': names, 'age': ages})
    students = pd.concat([students, pd.DataFrame(scores, columns=subjects)], axis=1)
    
    students.head()