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 graphviz import Digraph | |
class PedIndex(): | |
""" | |
0以上の整数を入力してそれに対応する血統上の親を出力する。 | |
ped_indexナンバリング方法 : 父(0)、母(1)、父父(2)、父母(3)、母父(4)、母母(5)、父父父(6)、父父母(7)、父母父(8)、父母母(9)、... | |
""" | |
def __init__(self, ped_index: int=0): | |
self.set_ped_index(ped_index) |
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 os | |
import glob | |
def get_file_name_list(files, path): | |
return [s.replace(path[:-1], '').replace('/', '').replace('\\' , '') for s in files] | |
before_word = '東京' | |
after_word = 'tokyo' | |
dir_path = 'C:/Users/potass/' # ファイルのあるディレクトリ名 |
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
Option Explicit | |
Sub Plot_Move() | |
Dim i As Long | |
Dim t As Long | |
Dim PLOT_DATA_NUM As Long | |
Dim INTERVAL_msec As Long | |
PLOT_DATA_NUM = 15 |
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
Option Explicit | |
Const IntervalSld As Double = 2.5 'スライド切替時間[sec] | |
Const NumSelectSld As Long = 3 '日ごとに選択するスライド総数 | |
Dim d0 As Date 'マクロ開始時の日付 | |
Dim j0 As Long '日付d0での選択スライドの番号 | |
'スライドショー実行(メイン) | |
Sub MainLoop() |
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
Option Explicit | |
Sub sample_ReadWordFromExcelVBA() | |
' ファイル名、拡張子検索用 | |
Dim objFso As Object | |
Dim objF As Object | |
Dim dir As String | |
Dim ext As String | |
Dim filelist() As String | |
Dim picktag As String |
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
# coding: utf-8 | |
import numpy as np | |
import pandas as pd | |
import matplotlib.pyplot as plt | |
alpha = 5.0e-03 | |
beta = 11.1 | |
def makems(m, dataset): | |
Phi = np.array([dataset.x.values**k for k in range(0, m+1)]) |
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
# coding: utf-8 | |
import numpy as np | |
import pandas as pd | |
import matplotlib.pyplot as plt | |
def y(w, x): | |
y = 0. | |
for i, ww in enumerate(w): | |
y += ww*(x**i) | |
return y |
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
# coding: utf-8 | |
import numpy as np | |
import pandas as pd | |
import matplotlib.pyplot as plt | |
def y(w, x): | |
y = 0. | |
for i, ww in enumerate(w): | |
y += ww*(x**i) | |
return y |
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
# coding: utf-8 | |
import numpy as np | |
import pandas as pd | |
import matplotlib.pyplot as plt | |
def main(): | |
M = 9 | |
N = [15, 100] | |
sigma = 0.3 | |
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
# coding: utf-8 | |
import numpy as np | |
import pandas as pd | |
import matplotlib.pyplot as plt | |
def rms(p, df): | |
error = 0. | |
for index, list in df.iterrows(): | |
error += 0.5*(np.polyval(p, list.x)-list.t)**2 | |
return np.sqrt(2.*error/len(df)) |
NewerOlder