Skip to content

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
Spinner
DataFrameas
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;

import folium

Create a map centered around New York

m = 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(m)

Display the map

m

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
# Import the necessary packages
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
from sklearn.metrics import classification_report

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 plotlypress 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 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!