DEV Community

Arindam Basu
Arindam Basu

Posted on

How to host a data driven blog from Jupyter notebook to here

Pushing from Google colab

If you work with Google Colab notebooks, you can either copy and paste the link to the notebook as in here:

Colab notebook link

This is workable, but not quite the thing I was looking for. Then I tried with Deepnote.
It was the same thing. I could copy paste from each cell and paste here. They gave me a couple of ways to share the notebook, both of them roughly equivalent and not too much different from what Google Colab allowed me.

Deepnote notebook link

Or one can paste a viewable link, as in here:

Deepnote view/edit link

The other alternative would be to copy paste from each cell here. A better way might be to work on a hosted jupyter notebook and paste from there to here.

It is possible that for both Google Colab and Deepnote, I could export the documents as ipynb files and then do something like pandoc -f ipynb -t markdown filename.ipynb and work with it.

Exporting a notebook from hosted Jupyter notebook

Working with a self-hosted jupyterlab/jupyter notebook is more straightforward. I could run the analyses, and then I was able to directly export the notebook as markdown file and copy paste from the file. All images can be directly pushed into this editor.

import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
import seaborn as sns
Enter fullscreen mode Exit fullscreen mode
x = [1,2,3,4,5]
y = [3,4,5,6,7]
xydata = pd.DataFrame({"x":x, "y":y})
xydata.head()
Enter fullscreen mode Exit fullscreen mode
.dataframe tbody tr th:only-of-type {
    vertical-align: middle;
}

.dataframe tbody tr th {
    vertical-align: top;
}

.dataframe thead th {
    text-align: right;
}
Enter fullscreen mode Exit fullscreen mode
x y
0 1 3
1 2 4
2 3 5
3 4 6
4 5 7
%matplotlib inline
plt.scatter(x,y)
plt.plot(x,y)
Enter fullscreen mode Exit fullscreen mode

output_2_1

Discussion (0)