Edward O'Flaherty
‌
‌
‌
‌
‌
‌
‌
‌
‌
‌
‌
‌
‌
‌
Sign up
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.

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.
# 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

# Other packages
import matplotlib.pyplot as plt
import seaborn as sns
%matplotlib inline

2. Build Beautiful Visualizations

Try this Prompt:

Create a Plotly plot of monthly sales in 2011 based on online_retail.csv.
# Import necessary libraries
import pandas as pd
import plotly.express as px

# Read the data
data = pd.read_csv('online_retail.csv')

# Convert InvoiceDate column to datetime
data['InvoiceDate'] = pd.to_datetime(data['InvoiceDate'])

# Filter data for 2011
data_2011 = data[data['InvoiceDate'].dt.year == 2011]

# Group data by month and calculate total sales
monthly_sales = data_2011.groupby(data_2011['InvoiceDate'].dt.month)['Quantity'].sum().reset_index()

# Create plot
fig = px.bar(monthly_sales, x='InvoiceDate', y='Quantity', title='Monthly Sales in 2011')

# Show plot
fig.show()

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".
Unknown integration
DataFrameavailable as
df
variable
SELECT Country, COUNT(*) AS Purchase_Count
FROM online_retail
GROUP BY Country
ORDER BY Purchase_Count DESC
LIMIT 3;
This query is taking long to finish...Consider adding a LIMIT clause or switching to Query mode to preview the result.

4. Write a Summary

Try this prompt:

Write a summary of the analysis in this workspace.

Summary

The analysis in this workspace focused on the 'online_retail' dataset. The following tasks were performed:

  1. Querying the database to find the top 3 countries from which customers make purchases.
  2. Writing a summary of the analysis.

Overall, the analysis provided insights into customer purchasing behavior and summarized the findings in a concise manner.

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

  • AI Chat
  • Code