79638419

Date: 2025-05-26 06:40:42
Score: 1.5
Natty:
Report link

Did u mean to statically restrict shape of the ndarray? For example, if u want a to be a (3, 4)-shaped float64 array, you can write like this:

from typing import Literal as L
import numpy as np
a: np.ndarray[tuple[L[3], L[4]], np.dtype[np.float64]] = np.zeros((3, 4), dtype=np.float64)

But most of the time u don't have to.

Reasons:
  • Has code block (-0.5):
  • Contains question mark (0.5):
  • Starts with a question (0.5): Did
  • Low reputation (1):
Posted by: iw17