Skip to content

Instantly share code, notes, and snippets.

View kozo496's full-sized avatar

kozo496 kozo496

View GitHub Profile
@kozo496
kozo496 / jupyter_nbconvert.sh
Created July 27, 2023 07:22
jupyter_nbconvert
# jupyter ipynbファイルをhtmlに変換. コードはアウトプットしない場合
jupyter nbconvert --to html jupyter_file.ipynb --no-input
@kozo496
kozo496 / NEURON_set_recording_vector.py
Last active July 27, 2023 07:23
NEURON recording vector
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)
@kozo496
kozo496 / pandoc_1.sh
Created June 4, 2022 00:12
pandoc基本
pandoc -f markdown -t html notebook.md > output.html
@kozo496
kozo496 / open_text_file_1.py
Created June 3, 2022 23:20
textファイルを読み込んで、行ごとのリストにする。
# `test.txt`ファイルから一行ずつ読み込む
with open('test.txt', 'r) as f:
lines = [line.rstrip() for line in f]
@kozo496
kozo496 / first_crossing_point.ipynb
Last active June 1, 2022 14:59
最初に閾値を超える値のindexを求める
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@kozo496
kozo496 / linear_regression.py
Last active June 1, 2022 13:58
Numpyを使った線形回帰
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