diff --git a/doc/python/3d-mesh.md b/doc/python/3d-mesh.md
index 610c8153a9..edec74b624 100644
--- a/doc/python/3d-mesh.md
+++ b/doc/python/3d-mesh.md
@@ -154,6 +154,8 @@ Whereas the previous example used the default `intensitymode='vertex'`, we plot
```python
import plotly.graph_objects as go
+import numpy as np
+
fig = go.Figure(data=[
go.Mesh3d(
# 8 vertices of a cube
diff --git a/doc/python/axes.md b/doc/python/axes.md
index df8672e0e2..2739c6fcc4 100644
--- a/doc/python/axes.md
+++ b/doc/python/axes.md
@@ -118,7 +118,7 @@ The PX `labels` argument can also be used without a data frame argument:
```python
import plotly.express as px
-fig = px.bar(df, x=["Apples", "Oranges"], y=[10,20], color=["Here", "There"],
+fig = px.bar(x=["Apples", "Oranges"], y=[10,20], color=["Here", "There"],
labels=dict(x="Fruit", y="Amount", color="Place")
)
fig.show()
@@ -460,6 +460,7 @@ Here, `ticklabelstandoff=15` moves the labels 15 pixels further away from the x-
```python
import plotly.express as px
+import pandas as pd
df = pd.read_csv('https://raw.githubusercontent.com/plotly/datasets/master/finance-charts-apple.csv')
@@ -487,6 +488,7 @@ To draw the label for the minor tick before each major tick, set `ticklabelindex
```python
import plotly.express as px
+import pandas as pd
df = pd.read_csv('https://raw.githubusercontent.com/plotly/datasets/master/finance-charts-apple.csv')
diff --git a/doc/python/box-plots.md b/doc/python/box-plots.md
index 244c21106e..1eaec475db 100644
--- a/doc/python/box-plots.md
+++ b/doc/python/box-plots.md
@@ -448,6 +448,7 @@ fig.show()
```python
import plotly.graph_objects as go
+import numpy as np
x_data = ['Carmelo Anthony', 'Dwyane Wade',
'Deron Williams', 'Brook Lopez',
diff --git a/doc/python/creating-and-updating-figures.md b/doc/python/creating-and-updating-figures.md
index 694e0d1ae0..b23d69e41b 100644
--- a/doc/python/creating-and-updating-figures.md
+++ b/doc/python/creating-and-updating-figures.md
@@ -206,6 +206,7 @@ fig.show()
The `plotly.subplots.make_subplots()` function produces a graph object figure that is preconfigured with a grid of subplots that traces can be added to. The `add_trace()` function will be discussed more below.
```python
+import plotly.graph_objects as go
from plotly.subplots import make_subplots
fig = make_subplots(rows=1, cols=2)
@@ -260,6 +261,7 @@ fig.show()
If a figure was created using `plotly.subplots.make_subplots()`, then supplying the `row` and `col` arguments to `add_trace()` can be used to add a trace to a particular subplot.
```python
+import plotly.graph_objects as go
from plotly.subplots import make_subplots
fig = make_subplots(rows=1, cols=2)
@@ -274,6 +276,7 @@ This also works for figures created by Plotly Express using the `facet_row` and
```python
import plotly.express as px
+import plotly.graph_objects as go
df = px.data.iris()
diff --git a/doc/python/imshow.md b/doc/python/imshow.md
index bec3b83de9..08be73e298 100644
--- a/doc/python/imshow.md
+++ b/doc/python/imshow.md
@@ -274,6 +274,7 @@ fig.show()
### Displaying an image and the histogram of color values
```python
+import plotly.graph_objects as go
from plotly.subplots import make_subplots
from skimage import data
img = data.chelsea()
diff --git a/doc/python/network-graphs.md b/doc/python/network-graphs.md
index ae47e9923c..c9d85b5aa3 100644
--- a/doc/python/network-graphs.md
+++ b/doc/python/network-graphs.md
@@ -128,6 +128,8 @@ node_trace.text = node_text
#### Create Network Graph
```python
+import plotly.graph_objects as go
+
fig = go.Figure(data=[edge_trace, node_trace],
layout=go.Layout(
title=dict(
diff --git a/doc/python/ohlc-charts.md b/doc/python/ohlc-charts.md
index f59228b79c..a11a06970a 100644
--- a/doc/python/ohlc-charts.md
+++ b/doc/python/ohlc-charts.md
@@ -138,6 +138,8 @@ import plotly.graph_objects as go
import pandas as pd
from datetime import datetime
+df = pd.read_csv('https://raw.githubusercontent.com/plotly/datasets/master/finance-charts-apple.csv')
+
hovertext=[]
for i in range(len(df['AAPL.Open'])):
hovertext.append('Open: '+str(df['AAPL.Open'][i])+'
Close: '+str(df['AAPL.Close'][i]))
diff --git a/doc/python/templates.md b/doc/python/templates.md
index b110b736b1..070d8633f3 100644
--- a/doc/python/templates.md
+++ b/doc/python/templates.md
@@ -389,6 +389,7 @@ Combining themes is also supported by Plotly Express
```python
import plotly.io as pio
+import plotly.graph_objects as go
import plotly.express as px
pio.templates["draft"] = go.layout.Template(
diff --git a/doc/python/time-series.md b/doc/python/time-series.md
index c55ffef7a4..bc3ee71df1 100644
--- a/doc/python/time-series.md
+++ b/doc/python/time-series.md
@@ -325,7 +325,7 @@ fig.show()
```
```python
-import plotly.graph_objects as go
+import plotly.express as px
import pandas as pd
df = pd.read_csv('https://raw.githubusercontent.com/plotly/datasets/master/finance-charts-apple.csv')