Project

General

Profile

Introduction to Conda and Jupyter notebook » some_material.txt

David CORRE, 2017-10-26 08:16

 
# Conda py27
conda create -n py27 python=2.7 anaconda

# Export environment
conda env export > environment.yml

#write manually a yml environment file
name: stats2
channels:
- javascript
dependencies:
- python=3.4 # or 2.7
- bokeh=0.9.2
- numpy=1.9.*
- nodejs=0.10.*
- flask
- pip:
- Flask-Testing

# Create environment from file
conda env create -f environment.yml

# Exemple matplotlib
"""
Simple demo with multiple subplots.
"""
import numpy as np
import matplotlib.pyplot as plt


x1 = np.linspace(0.0, 5.0)
x2 = np.linspace(0.0, 2.0)

y1 = np.cos(2 * np.pi * x1) * np.exp(-x1)
y2 = np.cos(2 * np.pi * x2)

plt.subplot(2, 1, 1)
plt.plot(x1, y1, 'o-')
plt.title('A tale of 2 subplots')
plt.ylabel('Damped oscillation')

plt.subplot(2, 1, 2)
plt.plot(x2, y2, '.-')
plt.xlabel('time (s)')
plt.ylabel('Undamped')

plt.show()

# Reload import
%load_ext autoreload
%autoreload 2


# Load video
<iframe width="560" height="315" src="https://www.youtube.com/embed/YJC6ldI3hWk" frameborder="0" allowfullscreen></iframe>




(2-2/2)