---
source: crates/ruff_linter/src/rules/numpy/mod.rs
---
NPY003 [*] `np.round_` is deprecated; use `np.round` instead
 --> NPY003.py:4:5
  |
2 |     import numpy as np
3 |
4 |     np.round_(np.random.rand(5, 5), 2)
  |     ^^^^^^^^^
5 |     np.product(np.random.rand(5, 5))
6 |     np.cumproduct(np.random.rand(5, 5))
  |
help: Replace with `np.round`
  |
3 |
  -     np.round_(np.random.rand(5, 5), 2)
4 +     np.round(np.random.rand(5, 5), 2)
5 |     np.product(np.random.rand(5, 5))
  |

NPY003 [*] `np.product` is deprecated; use `np.prod` instead
 --> NPY003.py:5:5
  |
4 |     np.round_(np.random.rand(5, 5), 2)
5 |     np.product(np.random.rand(5, 5))
  |     ^^^^^^^^^^
6 |     np.cumproduct(np.random.rand(5, 5))
7 |     np.sometrue(np.random.rand(5, 5))
  |
help: Replace with `np.prod`
  |
4 |     np.round_(np.random.rand(5, 5), 2)
  -     np.product(np.random.rand(5, 5))
5 +     np.prod(np.random.rand(5, 5))
6 |     np.cumproduct(np.random.rand(5, 5))
  |

NPY003 [*] `np.cumproduct` is deprecated; use `np.cumprod` instead
 --> NPY003.py:6:5
  |
4 |     np.round_(np.random.rand(5, 5), 2)
5 |     np.product(np.random.rand(5, 5))
6 |     np.cumproduct(np.random.rand(5, 5))
  |     ^^^^^^^^^^^^^
7 |     np.sometrue(np.random.rand(5, 5))
8 |     np.alltrue(np.random.rand(5, 5))
  |
help: Replace with `np.cumprod`
  |
5 |     np.product(np.random.rand(5, 5))
  -     np.cumproduct(np.random.rand(5, 5))
6 +     np.cumprod(np.random.rand(5, 5))
7 |     np.sometrue(np.random.rand(5, 5))
  |

NPY003 [*] `np.sometrue` is deprecated; use `np.any` instead
 --> NPY003.py:7:5
  |
5 |     np.product(np.random.rand(5, 5))
6 |     np.cumproduct(np.random.rand(5, 5))
7 |     np.sometrue(np.random.rand(5, 5))
  |     ^^^^^^^^^^^
8 |     np.alltrue(np.random.rand(5, 5))
  |
help: Replace with `np.any`
  |
6 |     np.cumproduct(np.random.rand(5, 5))
  -     np.sometrue(np.random.rand(5, 5))
7 +     np.any(np.random.rand(5, 5))
8 |     np.alltrue(np.random.rand(5, 5))
  |

NPY003 [*] `np.alltrue` is deprecated; use `np.all` instead
 --> NPY003.py:8:5
  |
6 |     np.cumproduct(np.random.rand(5, 5))
7 |     np.sometrue(np.random.rand(5, 5))
8 |     np.alltrue(np.random.rand(5, 5))
  |     ^^^^^^^^^^
  |
help: Replace with `np.all`
  |
7 |     np.sometrue(np.random.rand(5, 5))
  -     np.alltrue(np.random.rand(5, 5))
8 +     np.all(np.random.rand(5, 5))
9 |
  |

NPY003 [*] `np.round_` is deprecated; use `np.round` instead
  --> NPY003.py:14:5
   |
12 |     from numpy import round_, product, cumproduct, sometrue, alltrue
13 |
14 |     round_(np.random.rand(5, 5), 2)
   |     ^^^^^^
15 |     product(np.random.rand(5, 5))
16 |     cumproduct(np.random.rand(5, 5))
   |
help: Replace with `np.round`
   |
1  + from numpy import round
2  | def func():
--------------------------------------------------------------------------------
14 |
   -     round_(np.random.rand(5, 5), 2)
15 +     round(np.random.rand(5, 5), 2)
16 |     product(np.random.rand(5, 5))
   |

NPY003 [*] `np.product` is deprecated; use `np.prod` instead
  --> NPY003.py:15:5
   |
14 |     round_(np.random.rand(5, 5), 2)
15 |     product(np.random.rand(5, 5))
   |     ^^^^^^^
16 |     cumproduct(np.random.rand(5, 5))
17 |     sometrue(np.random.rand(5, 5))
   |
help: Replace with `np.prod`
   |
1  + from numpy import prod
2  | def func():
--------------------------------------------------------------------------------
15 |     round_(np.random.rand(5, 5), 2)
   -     product(np.random.rand(5, 5))
16 +     prod(np.random.rand(5, 5))
17 |     cumproduct(np.random.rand(5, 5))
   |

NPY003 [*] `np.cumproduct` is deprecated; use `np.cumprod` instead
  --> NPY003.py:16:5
   |
14 |     round_(np.random.rand(5, 5), 2)
15 |     product(np.random.rand(5, 5))
16 |     cumproduct(np.random.rand(5, 5))
   |     ^^^^^^^^^^
17 |     sometrue(np.random.rand(5, 5))
18 |     alltrue(np.random.rand(5, 5))
   |
help: Replace with `np.cumprod`
   |
1  + from numpy import cumprod
2  | def func():
--------------------------------------------------------------------------------
16 |     product(np.random.rand(5, 5))
   -     cumproduct(np.random.rand(5, 5))
17 +     cumprod(np.random.rand(5, 5))
18 |     sometrue(np.random.rand(5, 5))
   |

NPY003 [*] `np.sometrue` is deprecated; use `np.any` instead
  --> NPY003.py:17:5
   |
15 |     product(np.random.rand(5, 5))
16 |     cumproduct(np.random.rand(5, 5))
17 |     sometrue(np.random.rand(5, 5))
   |     ^^^^^^^^
18 |     alltrue(np.random.rand(5, 5))
   |
help: Replace with `np.any`
   |
1  + from numpy import any
2  | def func():
--------------------------------------------------------------------------------
17 |     cumproduct(np.random.rand(5, 5))
   -     sometrue(np.random.rand(5, 5))
18 +     any(np.random.rand(5, 5))
19 |     alltrue(np.random.rand(5, 5))
   |

NPY003 [*] `np.alltrue` is deprecated; use `np.all` instead
  --> NPY003.py:18:5
   |
16 |     cumproduct(np.random.rand(5, 5))
17 |     sometrue(np.random.rand(5, 5))
18 |     alltrue(np.random.rand(5, 5))
   |     ^^^^^^^
   |
help: Replace with `np.all`
   |
1  + from numpy import all
2  | def func():
--------------------------------------------------------------------------------
18 |     sometrue(np.random.rand(5, 5))
   -     alltrue(np.random.rand(5, 5))
19 +     all(np.random.rand(5, 5))
   |
