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
# 高精度浮點數計算 | |
#減 | |
$disPrice = bcsub($numA, $numB, 2); |
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 tensorflow as tf | |
import pandas as pd | |
import numpy as np | |
from scipy import stats | |
import itertools | |
import matplotlib.pylab as plt | |
# 白努力分配 | |
size = 10000 | |
p = 0.4 |
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 pandas as pd | |
dataDic = { | |
'Weather': [ | |
'Sunny', | |
'Overcast', | |
'Rainy', | |
'Sunny', | |
'Sunny', | |
'Overcast', |
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 scipy import stats | |
# 常態分佈檢定 | |
staRs = stats.shapiro(df2["正面統計"]) | |
if staRs[1] > 0.05: | |
print('為常態分佈') | |
else: | |
print('不為常態分佈') |
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
df2.win_odds.unique() |
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
##評價模型數據(loss + acc) | |
model.evaluate(x_test, [yN1_test, yN2_test, yN3_test]) | |
##取得評價模型返回值key | |
model.metrics_names |
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
########################################## | |
pandas的axis的理解: 用運算的方向理解 | |
########################################## | |
axis=0 => 水平軸開始,延著垂直軸移動。 | |
axis=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
# 信號 | |
import signal | |
import sys, os | |
import time | |
import requests | |
# ########################################################################### | |
# 常用信号类型 | |
# SIGINT 终止进程 中断进程,不可通过signal.signal()捕捉(相当于Ctrl+C) | |
# SIGTERM 终止进程 软件终止信号,可通过signal.signal()捕捉(默认信号,当os.kill()没有指明信号类型时,默认的是该信号) |
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
# 變更欄位型態 | |
df['allN'] = df['allN'].astype(np.str) | |
predicts['預測號碼1'] = predicts['預測號碼1'].astype(str) |
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
# 排序欄位值 | |
df.sort_values('periods') | |
# 重新排序欄位順序 | |
orderCol = ['ballDate', 'periods', 'ballN1', 'ballN2', 'ballN3', 'allN'] | |
df = df[orderCol] |