Skip to content

Commit

Permalink
优化
Browse files Browse the repository at this point in the history
优化
  • Loading branch information
chenyibadou authored Jun 24, 2024
1 parent 1767288 commit 8d02022
Showing 1 changed file with 3 additions and 7 deletions.
10 changes: 3 additions & 7 deletions 226+陈易+武汉/26.标准化.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,8 @@ def z_score(x):
def draw(x):
count_sum = []
for i in x:
count = x.count(i)
count_sum.append(count)
count = x.count(i) # 每个元素的个数
count_sum.append(count) # 记录每个元素的个数
return count_sum

if __name__ == '__main__':
Expand All @@ -56,11 +56,7 @@ def draw(x):
print("-1~1归一化:\n",b)
print("零均值归一化:\n",c)

count_sum = []
for i in x:
count = x.count(i) # 每个元素的个数
count_sum.append(count) # 记录每个元素的个数

count_sum = draw(x)
""""
绘图 plt.plot(x, y, fmt, **kwargs):
x:表示X轴上的数据点,通常是一个列表、数组或一维序列,用于指定数据点的水平位置
Expand Down

0 comments on commit 8d02022

Please sign in to comment.