Skip to content

How to use the Workspace AI Assistant

Use AI to write code

  • Click the cell below.
  • In the cell menu, click "AI".
  • In the text box that appears, type in "Create a map pointing to the Eiffel tower" and hit Enter.
  • In the cell menu, click "Accept & Run" to accept and run the suggested code.
import folium

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

# Add a marker for the Eiffel Tower
folium.Marker(
    location=[48.8584, 2.2945],
    popup="Eiffel Tower",
    icon=folium.Icon(icon="cloud")
).add_to(map_eiffel_tower)

# Display the map
map_eiffel_tower

Use AI to fix an error

  • Try to run the cell below. It errors!
  • Click "Fix and explain" to have the AI assistant fix the code and explain the mistake.
3 + '6'

What to do next

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!

Run cancelled
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, classification_report
Run cancelled
import plotly.express as px

# Get the top 10 most common jobs
top_10_jobs = df['job'].value_counts().head(10)

# Create a bar plot
fig = px.bar(top_10_jobs, x=top_10_jobs.index, y=top_10_jobs.values)

# Set the title and axis labels
fig.update_layout(
    title="Top 10 Most Common Jobs",
    xaxis_title="Job",
    yaxis_title="Count"
)

# Show the plot
fig.show()
Run cancelled
import pandas as pd

# Load the dataset
file_path = './bq-results-20240426-055308-1714110803114.csv'
df = pd.read_csv(file_path)

# Group by category and sum the recent_month_sales
best_selling_category = df.groupby('category')['recent_month_sales'].sum().idxmax()

# Display the best selling category
best_selling_category