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.

Get started with AI, follow these steps:

  1. Hover on the space in between cells and add a new cell by clicking the "plus" icon or the line.
  2. Type in your first prompt.
  3. Click on "Ask AI" or press the return key.

1. Automatically Handle All Your Package Imports

Try this prompt:

Import the packages I will need to perform a machine learning classification task.

2. Build Beautiful Visualizations

Try this Prompt:

Create a Plotly plot of monthly sales in 2011 based on online_retail.csv.
# Import the required packages
import folium

# Create a map centered at the Eiffel Tower
eiffel_tower_location = [48.8584, 2.2945]
map_eiffel_tower = folium.Map(location=eiffel_tower_location, zoom_start=15)

# Add a marker for the Eiffel Tower
folium.Marker(location=eiffel_tower_location, popup='Eiffel Tower').add_to(map_eiffel_tower)

# Display the map
map_eiffel_tower

3. Speed Up Your SQL

First create a SQL cell and select the "employees" sample database source. To the question "which countries do our customers purchase from?" using a SQL query, try this prompt:

Write a SQL query that lists the top 3 countries from which customers make purchases and run it against "online_retail.csv".
# Import the required packages
import pandas as pd
from sklearn.model_selection import train_test_split
from sklearn.linear_model import LogisticRegression
from sklearn.metrics import accuracy_score

# Load the dataset
url = 'https://raw.githubusercontent.com/datasciencedojo/datasets/master/titanic.csv'
df = pd.read_csv(url)

# Preprocess the data
X = df[['Pclass', 'Sex', 'Age', 'Fare']]
y = df['Survived']
X['Sex'] = X['Sex'].map({'male': 0, 'female': 1})
X['Age'].fillna(X['Age'].mean(), inplace=True)
X['Fare'].fillna(X['Fare'].mean(), inplace=True)

# Split the data into training and testing sets
X_train, X_test, y_train, y_test = train_test_split(X, y, test_size=0.2, random_state=42)

# Build the classification model
model = LogisticRegression()
model.fit(X_train, y_train)

# Make predictions
y_pred = model.predict(X_test)

# Calculate accuracy
accuracy = accuracy_score(y_test, y_pred)
accuracy

4. Write a Summary

Try this prompt:

Write a summary of the analysis in this workspace.
Spinner
DataFrameas
df
variable
SELECT companies.company, funding.valuation
FROM companies
JOIN funding ON companies.company_id = funding.company_id;

5. Format Your Code

Directly below the code cell that follows, try this prompt:

Update the cell above to follow PEP 8 standards.
result=5+5;print(result)

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