このページの2つのバージョン間の差分を表示します。
両方とも前のリビジョン前のリビジョン次のリビジョン | 前のリビジョン | ||
priv:python [2022/02/25 11:53] – admin | priv:python [2022/08/17 01:09] (現在) – admin | ||
---|---|---|---|
行 1: | 行 1: | ||
===== Python ===== | ===== Python ===== | ||
+ | |||
+ | === ソースコードの難読化 === | ||
+ | * [[https:// | ||
+ | |||
+ | === 相関係数 === | ||
+ | <code python> | ||
+ | import pandas as pd | ||
+ | import numpy as np | ||
+ | l1=list(np.random.randint(0, | ||
+ | l2=list(np.random.randint(0, | ||
+ | s1=pd.Series(l1) | ||
+ | s2=pd.Series(l2) | ||
+ | res=s1.corr(s2) | ||
+ | print(res) | ||
+ | </ | ||
+ | |||
+ | === よくあるパターン === | ||
面倒なのでよくあるパターンを列挙します。 | 面倒なのでよくあるパターンを列挙します。 | ||
+ | <code python> | ||
# | # | ||
# -*- coding: | # -*- coding: | ||
行 37: | 行 55: | ||
if i % 100 == 99: | if i % 100 == 99: | ||
outfile.close() | outfile.close() | ||
+ | |||
+ | </ | ||