This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import numpy as np | |
def linear_regression(x,y): | |
A = np.vstack([x, np.ones(len(x))]).T | |
a, b = np.linalg.lstsq(A, y, rcond=None)[0] | |
return a, b |
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# `test.txt`ファイルから一行ずつ読み込む | |
with open('test.txt', 'r) as f: | |
lines = [line.rstrip() for line in f] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
pandoc -f markdown -t html notebook.md > output.html |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from neuron import h | |
# set voltage vector at a middle of "soma" of "my_cell" | |
soma_v = h.Vector().record(my_cell.soma(0.5)._ref_v) | |
t = h.Vector().record(h._ref_t) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# jupyter ipynbファイルをhtmlに変換. コードはアウトプットしない場合 | |
jupyter nbconvert --to html jupyter_file.ipynb --no-input |