MCPcopy Create free account
hub / github.com/numpy/numpy / __setitem__

Method __setitem__

numpy/lib/polynomial.py:1411–1420  ·  view source on GitHub ↗
(self, key, val)

Source from the content-addressed store, hash-verified

1409 return self.coeffs[ind]
1410
1411 def __setitem__(self, key, val):
1412 ind = self.order - key
1413 if key < 0:
1414 raise ValueError("Does not support negative powers.")
1415 if key > self.order:
1416 zr = NX.zeros(key-self.order, self.coeffs.dtype)
1417 self._coeffs = NX.concatenate((zr, self.coeffs))
1418 ind = 0
1419 self._coeffs[ind] = val
1420 return
1421
1422 def __iter__(self):
1423 return iter(self.coeffs)

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected