Skip to content

Instantly share code, notes, and snippets.

View firstfu's full-sized avatar
🧸
Focusing

firstfu firstfu

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