Jupyter notebook example#

Here is an example page built with Jupyter Notebooks

Subsection 1#

Here is a subsection

Subsection 2#

Here is another subsection.

Here is some $m^at_h$

$$e^{i\pi} = -1$$

And here comes some code!

### python is the default for code cells, since we are running a Python3 kernel. This could be changed though.
import numpy as np
import matplotlib.pyplot as plt

xy = np.random.multivariate_normal([0,0], [[1, 0.8], [0.8, 1]], 1000)
plt.scatter(xy[:,0], xy[:,1], alpha=0.3)
---------------------------------------------------------------------------
ModuleNotFoundError                       Traceback (most recent call last)
Cell In[1], line 2
      1 ### python is the default for code cells, since we are running a Python3 kernel. This could be changed though.
----> 2 import numpy as np
      3 import matplotlib.pyplot as plt
      5 xy = np.random.multivariate_normal([0,0], [[1, 0.8], [0.8, 1]], 1000)

ModuleNotFoundError: No module named 'numpy'
%%bash
## bash cells can be run using %%bash magic

pwd
/home/alh/PycharmProjects/reedgroup.github.io/docs/Section1
%load_ext rpy2.ipython
### Can also use R cells, after installing R and python library rpy2, and loading rpy2.ipython
### following https://evodify.com/python-r-bash-jupyter-notebook/
%%R
### R cell using %%R magic

library(ggforce)
ggplot(iris, aes(Petal.Length, Petal.Width, colour = Species)) +
    geom_point() +
    facet_zoom(x = Species == "versicolor")
R[write to console]: Loading required package: ggplot2
../_images/0fd57a606b6df51e376e38211d80e1479237b11b723006adc6a1b477d3349c8b.png
for row in range(6):  
    for col in range(7):  
        if (row==0 and col %3 !=0)or(row==1 and col %3==0) or(row-col==2) or(row+col==8):  
            print("*",end=" ")  
        else:  
            print(end=" ")  
    print() 
 * *  * *  
*   *   * 
*      * 
 *    *  
  *  *   
   *