Skip to content

Commit 2126058

Browse files
committed
Move from numpy to random
Use the built-in random package to generate random numbers. No longer need numpy.
1 parent 728cf69 commit 2126058

File tree

3 files changed

+3
-4
lines changed

3 files changed

+3
-4
lines changed

README.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@ Support WeChat push, multi-user, scheduled auto report
99
## Quick Start
1010

1111
- Install `Python 3.*`
12-
- Install `numpy`
1312
- Install `selenium`
1413
- Install `schedule`
1514
- Install `requests`

README_zh-cn.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
## 安装 pip 依赖
2828

2929
``` bash
30-
pip install numpy selenium schedule requests
30+
pip install selenium schedule requests
3131
```
3232

3333
## 编辑配置文件

daily_reporter.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
from selenium.common import exceptions
33
from selenium.webdriver.chrome import options
44
from random import randint
5-
from numpy.random import normal
5+
from random import normalvariate
66
import requests
77
import time
88
import config
@@ -88,7 +88,7 @@ def report(user_index):
8888
# Generate temperature using normal distribution
8989
loc = int((min_value + max_value) / 2)
9090
scale = max_value - loc
91-
temperature = int(normal(loc=loc, scale=scale)) / 10
91+
temperature = int(normalvariate(loc, scale))
9292
if int(temperature * 10) < min_value or int(temperature * 10) > max_value:
9393
temperature = randint(min_value, max_value) / 10
9494

0 commit comments

Comments
 (0)