# Python numpy.polynomial.legendre.legval2d() Examples

The following are code examples for showing how to use numpy.polynomial.legendre.legval2d(). They are from open source Python projects. You can vote up the examples you like or vote down the ones you don't like.

Example 1
```def test_legval2d(self):
x1, x2, x3 = self.x
y1, y2, y3 = self.y

#test exceptions
assert_raises(ValueError, leg.legval2d, x1, x2[:2], self.c2d)

#test values
tgt = y1*y2
res = leg.legval2d(x1, x2, self.c2d)
assert_almost_equal(res, tgt)

#test shape
z = np.ones((2, 3))
res = leg.legval2d(z, z, self.c2d)
assert_(res.shape == (2, 3)) ```
Example 2
```def test_legval2d(self):
x1, x2, x3 = self.x
y1, y2, y3 = self.y

#test exceptions
assert_raises(ValueError, leg.legval2d, x1, x2[:2], self.c2d)

#test values
tgt = y1*y2
res = leg.legval2d(x1, x2, self.c2d)
assert_almost_equal(res, tgt)

#test shape
z = np.ones((2, 3))
res = leg.legval2d(z, z, self.c2d)
assert_(res.shape == (2, 3)) ```
Example 3
```def _construct_wavelength_map_matrices(self, normed_pixel, normed_order, order, **kwargs):
if self.grating_eq:
m_divisor = 1 / np.add(order, self.m0).astype(np.float64)
else:
m_divisor = np.ones_like(normed_pixel, dtype=np.float64)
columns = ()
for xpower in self.model:
for orderpower in self.model[xpower]:
coefficient_array = np.zeros((xpower+1, orderpower+1))
coefficient_array[xpower, orderpower] = 1
columns += (m_divisor * legendre.legval2d(normed_pixel, normed_order, coefficient_array),)
A = np.column_stack(columns)
if (0 not in self.model) or (0 not in self.model[0]):
# we force 0,0 coefficient to 1 for the overlap fit.
c = -1 * m_divisor.reshape(-1, 1)
else:
c = np.zeros_like(normed_pixel, dtype=np.float64).reshape(-1, 1)
return A, c ```
Example 4
```def test_legval2d(self):
x1, x2, x3 = self.x
y1, y2, y3 = self.y

#test exceptions
assert_raises(ValueError, leg.legval2d, x1, x2[:2], self.c2d)

#test values
tgt = y1*y2
res = leg.legval2d(x1, x2, self.c2d)
assert_almost_equal(res, tgt)

#test shape
z = np.ones((2, 3))
res = leg.legval2d(z, z, self.c2d)
assert_(res.shape == (2, 3)) ```
Example 5
 Project: att   Author: Centre-Alt-Rendiment-Esportiu   File: test_legendre.py    GNU General Public License v3.0 6 votes
```def test_legval2d(self):
x1, x2, x3 = self.x
y1, y2, y3 = self.y

#test exceptions
assert_raises(ValueError, leg.legval2d, x1, x2[:2], self.c2d)

#test values
tgt = y1*y2
res = leg.legval2d(x1, x2, self.c2d)
assert_almost_equal(res, tgt)

#test shape
z = np.ones((2, 3))
res = leg.legval2d(z, z, self.c2d)
assert_(res.shape == (2, 3)) ```
Example 6
```def test_legval2d(self):
x1, x2, x3 = self.x
y1, y2, y3 = self.y

#test exceptions
assert_raises(ValueError, leg.legval2d, x1, x2[:2], self.c2d)

#test values
tgt = y1*y2
res = leg.legval2d(x1, x2, self.c2d)
assert_almost_equal(res, tgt)

#test shape
z = np.ones((2, 3))
res = leg.legval2d(z, z, self.c2d)
assert_(res.shape == (2, 3)) ```
Example 7
 Project: MARRtino-2.0   Author: DaniAffCH   File: test_legendre.py    GNU General Public License v3.0 6 votes
```def test_legval2d(self):
x1, x2, x3 = self.x
y1, y2, y3 = self.y

#test exceptions
assert_raises(ValueError, leg.legval2d, x1, x2[:2], self.c2d)

#test values
tgt = y1*y2
res = leg.legval2d(x1, x2, self.c2d)
assert_almost_equal(res, tgt)

#test shape
z = np.ones((2, 3))
res = leg.legval2d(z, z, self.c2d)
assert_(res.shape == (2, 3)) ```
Example 8
```def test_legval2d(self):
x1, x2, x3 = self.x
y1, y2, y3 = self.y

#test exceptions
assert_raises(ValueError, leg.legval2d, x1, x2[:2], self.c2d)

#test values
tgt = y1*y2
res = leg.legval2d(x1, x2, self.c2d)
assert_almost_equal(res, tgt)

#test shape
z = np.ones((2, 3))
res = leg.legval2d(z, z, self.c2d)
assert_(res.shape == (2, 3)) ```
Example 9
```def test_legval2d(self):
x1, x2, x3 = self.x
y1, y2, y3 = self.y

#test exceptions
assert_raises(ValueError, leg.legval2d, x1, x2[:2], self.c2d)

#test values
tgt = y1*y2
res = leg.legval2d(x1, x2, self.c2d)
assert_almost_equal(res, tgt)

#test shape
z = np.ones((2, 3))
res = leg.legval2d(z, z, self.c2d)
assert_(res.shape == (2, 3)) ```
Example 10
```def test_legval2d(self):
x1, x2, x3 = self.x
y1, y2, y3 = self.y

#test exceptions
assert_raises(ValueError, leg.legval2d, x1, x2[:2], self.c2d)

#test values
tgt = y1*y2
res = leg.legval2d(x1, x2, self.c2d)
assert_almost_equal(res, tgt)

#test shape
z = np.ones((2, 3))
res = leg.legval2d(z, z, self.c2d)
assert_(res.shape == (2, 3)) ```
Example 11
```def test_legval2d(self):
x1, x2, x3 = self.x
y1, y2, y3 = self.y

#test exceptions
assert_raises(ValueError, leg.legval2d, x1, x2[:2], self.c2d)

#test values
tgt = y1*y2
res = leg.legval2d(x1, x2, self.c2d)
assert_almost_equal(res, tgt)

#test shape
z = np.ones((2, 3))
res = leg.legval2d(z, z, self.c2d)
assert_(res.shape == (2, 3)) ```
Example 12
```def test_legval2d(self):
x1, x2, x3 = self.x
y1, y2, y3 = self.y

#test exceptions
assert_raises(ValueError, leg.legval2d, x1, x2[:2], self.c2d)

#test values
tgt = y1*y2
res = leg.legval2d(x1, x2, self.c2d)
assert_almost_equal(res, tgt)

#test shape
z = np.ones((2, 3))
res = leg.legval2d(z, z, self.c2d)
assert_(res.shape == (2, 3)) ```
Example 13
```def test_legval2d(self):
x1, x2, x3 = self.x
y1, y2, y3 = self.y

#test exceptions
assert_raises(ValueError, leg.legval2d, x1, x2[:2], self.c2d)

#test values
tgt = y1*y2
res = leg.legval2d(x1, x2, self.c2d)
assert_almost_equal(res, tgt)

#test shape
z = np.ones((2, 3))
res = leg.legval2d(z, z, self.c2d)
assert_(res.shape == (2, 3)) ```
Example 14
```def test_legval2d(self):
x1, x2, x3 = self.x
y1, y2, y3 = self.y

#test exceptions
assert_raises(ValueError, leg.legval2d, x1, x2[:2], self.c2d)

#test values
tgt = y1*y2
res = leg.legval2d(x1, x2, self.c2d)
assert_almost_equal(res, tgt)

#test shape
z = np.ones((2, 3))
res = leg.legval2d(z, z, self.c2d)
assert_(res.shape == (2, 3)) ```
Example 15
 Project: 3dprinteros-client   Author: panasevychol   File: test_legendre.py    GNU Affero General Public License v3.0 6 votes
```def test_legval2d(self):
x1, x2, x3 = self.x
y1, y2, y3 = self.y

#test exceptions
assert_raises(ValueError, leg.legval2d, x1, x2[:2], self.c2d)

#test values
tgt = y1*y2
res = leg.legval2d(x1, x2, self.c2d)
assert_almost_equal(res, tgt)

#test shape
z = np.ones((2, 3))
res = leg.legval2d(z, z, self.c2d)
assert_(res.shape == (2, 3)) ```
Example 16
 Project: 3dprinteros-client   Author: panasevychol   File: test_legendre.py    GNU Affero General Public License v3.0 6 votes
```def test_legval2d(self):
x1, x2, x3 = self.x
y1, y2, y3 = self.y

#test exceptions
assert_raises(ValueError, leg.legval2d, x1, x2[:2], self.c2d)

#test values
tgt = y1*y2
res = leg.legval2d(x1, x2, self.c2d)
assert_almost_equal(res, tgt)

#test shape
z = np.ones((2, 3))
res = leg.legval2d(z, z, self.c2d)
assert_(res.shape == (2, 3)) ```
Example 17
```def test_legval2d(self):
x1, x2, x3 = self.x
y1, y2, y3 = self.y

#test exceptions
assert_raises(ValueError, leg.legval2d, x1, x2[:2], self.c2d)

#test values
tgt = y1*y2
res = leg.legval2d(x1, x2, self.c2d)
assert_almost_equal(res, tgt)

#test shape
z = np.ones((2, 3))
res = leg.legval2d(z, z, self.c2d)
assert_(res.shape == (2, 3)) ```
Example 18
```def test_legval2d(self):
x1, x2, x3 = self.x
y1, y2, y3 = self.y

#test exceptions
assert_raises(ValueError, leg.legval2d, x1, x2[:2], self.c2d)

#test values
tgt = y1*y2
res = leg.legval2d(x1, x2, self.c2d)
assert_almost_equal(res, tgt)

#test shape
z = np.ones((2, 3))
res = leg.legval2d(z, z, self.c2d)
assert_(res.shape == (2, 3)) ```
Example 19
```def test_legval2d(self):
x1, x2, x3 = self.x
y1, y2, y3 = self.y

#test exceptions
assert_raises(ValueError, leg.legval2d, x1, x2[:2], self.c2d)

#test values
tgt = y1*y2
res = leg.legval2d(x1, x2, self.c2d)
assert_almost_equal(res, tgt)

#test shape
z = np.ones((2, 3))
res = leg.legval2d(z, z, self.c2d)
assert_(res.shape == (2, 3)) ```
Example 20
```def test_legval2d(self):
x1, x2, x3 = self.x
y1, y2, y3 = self.y

#test exceptions
assert_raises(ValueError, leg.legval2d, x1, x2[:2], self.c2d)

#test values
tgt = y1*y2
res = leg.legval2d(x1, x2, self.c2d)
assert_almost_equal(res, tgt)

#test shape
z = np.ones((2, 3))
res = leg.legval2d(z, z, self.c2d)
assert_(res.shape == (2, 3)) ```
Example 21
```def test_legval2d(self):
x1, x2, x3 = self.x
y1, y2, y3 = self.y

#test exceptions
assert_raises(ValueError, leg.legval2d, x1, x2[:2], self.c2d)

#test values
tgt = y1*y2
res = leg.legval2d(x1, x2, self.c2d)
assert_almost_equal(res, tgt)

#test shape
z = np.ones((2, 3))
res = leg.legval2d(z, z, self.c2d)
assert_(res.shape == (2, 3)) ```
Example 22
 Project: facethin   Author: ParkerGod   File: test_legendre.py    GNU General Public License v3.0 6 votes
```def test_legval2d(self):
x1, x2, x3 = self.x
y1, y2, y3 = self.y

#test exceptions
assert_raises(ValueError, leg.legval2d, x1, x2[:2], self.c2d)

#test values
tgt = y1*y2
res = leg.legval2d(x1, x2, self.c2d)
assert_almost_equal(res, tgt)

#test shape
z = np.ones((2, 3))
res = leg.legval2d(z, z, self.c2d)
assert_(res.shape == (2, 3)) ```
Example 23
```def test_legval2d(self):
x1, x2, x3 = self.x
y1, y2, y3 = self.y

#test exceptions
assert_raises(ValueError, leg.legval2d, x1, x2[:2], self.c2d)

#test values
tgt = y1*y2
res = leg.legval2d(x1, x2, self.c2d)
assert_almost_equal(res, tgt)

#test shape
z = np.ones((2, 3))
res = leg.legval2d(z, z, self.c2d)
assert_(res.shape == (2, 3)) ```
Example 24
```def test_legval2d(self):
x1, x2, x3 = self.x
y1, y2, y3 = self.y

#test exceptions
assert_raises(ValueError, leg.legval2d, x1, x2[:2], self.c2d)

#test values
tgt = y1*y2
res = leg.legval2d(x1, x2, self.c2d)
assert_almost_equal(res, tgt)

#test shape
z = np.ones((2, 3))
res = leg.legval2d(z, z, self.c2d)
assert_(res.shape == (2, 3)) ```
Example 25
```def test_legval2d(self):
x1, x2, x3 = self.x
y1, y2, y3 = self.y

#test exceptions
assert_raises(ValueError, leg.legval2d, x1, x2[:2], self.c2d)

#test values
tgt = y1*y2
res = leg.legval2d(x1, x2, self.c2d)
assert_almost_equal(res, tgt)

#test shape
z = np.ones((2, 3))
res = leg.legval2d(z, z, self.c2d)
assert_(res.shape == (2, 3)) ```
Example 26
```def test_legval2d(self):
x1, x2, x3 = self.x
y1, y2, y3 = self.y

#test exceptions
assert_raises(ValueError, leg.legval2d, x1, x2[:2], self.c2d)

#test values
tgt = y1*y2
res = leg.legval2d(x1, x2, self.c2d)
assert_almost_equal(res, tgt)

#test shape
z = np.ones((2, 3))
res = leg.legval2d(z, z, self.c2d)
assert_(res.shape == (2, 3)) ```
Example 27
```def test_legval2d(self):
x1, x2, x3 = self.x
y1, y2, y3 = self.y

#test exceptions
assert_raises(ValueError, leg.legval2d, x1, x2[:2], self.c2d)

#test values
tgt = y1*y2
res = leg.legval2d(x1, x2, self.c2d)
assert_almost_equal(res, tgt)

#test shape
z = np.ones((2, 3))
res = leg.legval2d(z, z, self.c2d)
assert_(res.shape == (2, 3)) ```
Example 28
 Project: linux-cross-gcc   Author: nmercier   File: test_legendre.py    BSD 3-Clause "New" or "Revised" License 6 votes
```def test_legval2d(self):
x1, x2, x3 = self.x
y1, y2, y3 = self.y

#test exceptions
assert_raises(ValueError, leg.legval2d, x1, x2[:2], self.c2d)

#test values
tgt = y1*y2
res = leg.legval2d(x1, x2, self.c2d)
assert_almost_equal(res, tgt)

#test shape
z = np.ones((2, 3))
res = leg.legval2d(z, z, self.c2d)
assert_(res.shape == (2, 3)) ```
Example 29
```def test_legval2d(self):
x1, x2, x3 = self.x
y1, y2, y3 = self.y

#test exceptions
assert_raises(ValueError, leg.legval2d, x1, x2[:2], self.c2d)

#test values
tgt = y1*y2
res = leg.legval2d(x1, x2, self.c2d)
assert_almost_equal(res, tgt)

#test shape
z = np.ones((2, 3))
res = leg.legval2d(z, z, self.c2d)
assert_(res.shape == (2, 3)) ```
Example 30
```def test_legval2d(self):
x1, x2, x3 = self.x
y1, y2, y3 = self.y

#test exceptions
assert_raises(ValueError, leg.legval2d, x1, x2[:2], self.c2d)

#test values
tgt = y1*y2
res = leg.legval2d(x1, x2, self.c2d)
assert_almost_equal(res, tgt)

#test shape
z = np.ones((2, 3))
res = leg.legval2d(z, z, self.c2d)
assert_(res.shape == (2, 3)) ```
Example 31
```def test_legval2d(self):
x1, x2, x3 = self.x
y1, y2, y3 = self.y

#test exceptions
assert_raises(ValueError, leg.legval2d, x1, x2[:2], self.c2d)

#test values
tgt = y1*y2
res = leg.legval2d(x1, x2, self.c2d)
assert_almost_equal(res, tgt)

#test shape
z = np.ones((2, 3))
res = leg.legval2d(z, z, self.c2d)
assert_(res.shape == (2, 3)) ```
Example 32
 Project: honours_project   Author: JFriel   File: test_legendre.py    GNU General Public License v3.0 6 votes
```def test_legval2d(self):
x1, x2, x3 = self.x
y1, y2, y3 = self.y

#test exceptions
assert_raises(ValueError, leg.legval2d, x1, x2[:2], self.c2d)

#test values
tgt = y1*y2
res = leg.legval2d(x1, x2, self.c2d)
assert_almost_equal(res, tgt)

#test shape
z = np.ones((2, 3))
res = leg.legval2d(z, z, self.c2d)
assert_(res.shape == (2, 3)) ```
Example 33
 Project: honours_project   Author: JFriel   File: test_legendre.py    GNU General Public License v3.0 6 votes
```def test_legval2d(self):
x1, x2, x3 = self.x
y1, y2, y3 = self.y

#test exceptions
assert_raises(ValueError, leg.legval2d, x1, x2[:2], self.c2d)

#test values
tgt = y1*y2
res = leg.legval2d(x1, x2, self.c2d)
assert_almost_equal(res, tgt)

#test shape
z = np.ones((2, 3))
res = leg.legval2d(z, z, self.c2d)
assert_(res.shape == (2, 3)) ```
Example 34
```def test_legval2d(self):
x1, x2, x3 = self.x
y1, y2, y3 = self.y

#test exceptions
assert_raises(ValueError, leg.legval2d, x1, x2[:2], self.c2d)

#test values
tgt = y1*y2
res = leg.legval2d(x1, x2, self.c2d)
assert_almost_equal(res, tgt)

#test shape
z = np.ones((2, 3))
res = leg.legval2d(z, z, self.c2d)
assert_(res.shape == (2, 3)) ```
Example 35
 Project: PYPIC   Author: max614   File: test_legendre.py    BSD 2-Clause "Simplified" License 6 votes
```def test_legval2d(self):
x1, x2, x3 = self.x
y1, y2, y3 = self.y

#test exceptions
assert_raises(ValueError, leg.legval2d, x1, x2[:2], self.c2d)

#test values
tgt = y1*y2
res = leg.legval2d(x1, x2, self.c2d)
assert_almost_equal(res, tgt)

#test shape
z = np.ones((2, 3))
res = leg.legval2d(z, z, self.c2d)
assert_(res.shape == (2, 3)) ```
Example 36
 Project: PYPIC   Author: max614   File: test_legendre.py    BSD 2-Clause "Simplified" License 6 votes
```def test_legval2d(self):
x1, x2, x3 = self.x
y1, y2, y3 = self.y

#test exceptions
assert_raises(ValueError, leg.legval2d, x1, x2[:2], self.c2d)

#test values
tgt = y1*y2
res = leg.legval2d(x1, x2, self.c2d)
assert_almost_equal(res, tgt)

#test shape
z = np.ones((2, 3))
res = leg.legval2d(z, z, self.c2d)
assert_(res.shape == (2, 3)) ```
Example 37
 Project: PYPIC   Author: max614   File: test_legendre.py    BSD 2-Clause "Simplified" License 6 votes
```def test_legval2d(self):
x1, x2, x3 = self.x
y1, y2, y3 = self.y

#test exceptions
assert_raises(ValueError, leg.legval2d, x1, x2[:2], self.c2d)

#test values
tgt = y1*y2
res = leg.legval2d(x1, x2, self.c2d)
assert_almost_equal(res, tgt)

#test shape
z = np.ones((2, 3))
res = leg.legval2d(z, z, self.c2d)
assert_(res.shape == (2, 3)) ```
Example 38
 Project: offlow   Author: satwikkansal   File: test_legendre.py    GNU General Public License v3.0 6 votes
```def test_legval2d(self):
x1, x2, x3 = self.x
y1, y2, y3 = self.y

#test exceptions
assert_raises(ValueError, leg.legval2d, x1, x2[:2], self.c2d)

#test values
tgt = y1*y2
res = leg.legval2d(x1, x2, self.c2d)
assert_almost_equal(res, tgt)

#test shape
z = np.ones((2, 3))
res = leg.legval2d(z, z, self.c2d)
assert_(res.shape == (2, 3)) ```
Example 39
 Project: lambda-tensorflow-object-detection   Author: mikylucky   File: test_legendre.py    GNU General Public License v3.0 6 votes
```def test_legval2d(self):
x1, x2, x3 = self.x
y1, y2, y3 = self.y

#test exceptions
assert_raises(ValueError, leg.legval2d, x1, x2[:2], self.c2d)

#test values
tgt = y1*y2
res = leg.legval2d(x1, x2, self.c2d)
assert_almost_equal(res, tgt)

#test shape
z = np.ones((2, 3))
res = leg.legval2d(z, z, self.c2d)
assert_(res.shape == (2, 3)) ```
Example 40
 Project: elasticintel   Author: securityclippy   File: test_legendre.py    GNU General Public License v3.0 6 votes
```def test_legval2d(self):
x1, x2, x3 = self.x
y1, y2, y3 = self.y

#test exceptions
assert_raises(ValueError, leg.legval2d, x1, x2[:2], self.c2d)

#test values
tgt = y1*y2
res = leg.legval2d(x1, x2, self.c2d)
assert_almost_equal(res, tgt)

#test shape
z = np.ones((2, 3))
res = leg.legval2d(z, z, self.c2d)
assert_(res.shape == (2, 3)) ```
Example 41
```def test_legval2d(self):
x1, x2, x3 = self.x
y1, y2, y3 = self.y

#test exceptions
assert_raises(ValueError, leg.legval2d, x1, x2[:2], self.c2d)

#test values
tgt = y1*y2
res = leg.legval2d(x1, x2, self.c2d)
assert_almost_equal(res, tgt)

#test shape
z = np.ones((2, 3))
res = leg.legval2d(z, z, self.c2d)
assert_(res.shape == (2, 3)) ```
Example 42
```def test_legvander2d(self):
# also tests polyval2d for non-square coefficient array
x1, x2, x3 = self.x
c = np.random.random((2, 3))
van = leg.legvander2d(x1, x2, [1, 2])
tgt = leg.legval2d(x1, x2, c)
res = np.dot(van, c.flat)
assert_almost_equal(res, tgt)

# check shape
van = leg.legvander2d([x1], [x2], [1, 2])
assert_(van.shape == (1, 5, 6)) ```
Example 43
```def test_legvander2d(self):
# also tests polyval2d for non-square coefficient array
x1, x2, x3 = self.x
c = np.random.random((2, 3))
van = leg.legvander2d(x1, x2, [1, 2])
tgt = leg.legval2d(x1, x2, c)
res = np.dot(van, c.flat)
assert_almost_equal(res, tgt)

# check shape
van = leg.legvander2d([x1], [x2], [1, 2])
assert_(van.shape == (1, 5, 6)) ```
Example 44
```def test_legvander2d(self):
# also tests polyval2d for non-square coefficient array
x1, x2, x3 = self.x
c = np.random.random((2, 3))
van = leg.legvander2d(x1, x2, [1, 2])
tgt = leg.legval2d(x1, x2, c)
res = np.dot(van, c.flat)
assert_almost_equal(res, tgt)

# check shape
van = leg.legvander2d([x1], [x2], [1, 2])
assert_(van.shape == (1, 5, 6)) ```
Example 45
 Project: att   Author: Centre-Alt-Rendiment-Esportiu   File: test_legendre.py    GNU General Public License v3.0 5 votes
```def test_legvander2d(self):
# also tests polyval2d for non-square coefficient array
x1, x2, x3 = self.x
c = np.random.random((2, 3))
van = leg.legvander2d(x1, x2, [1, 2])
tgt = leg.legval2d(x1, x2, c)
res = np.dot(van, c.flat)
assert_almost_equal(res, tgt)

# check shape
van = leg.legvander2d([x1], [x2], [1, 2])
assert_(van.shape == (1, 5, 6)) ```
Example 46
```def test_legvander2d(self):
# also tests polyval2d for non-square coefficient array
x1, x2, x3 = self.x
c = np.random.random((2, 3))
van = leg.legvander2d(x1, x2, [1, 2])
tgt = leg.legval2d(x1, x2, c)
res = np.dot(van, c.flat)
assert_almost_equal(res, tgt)

# check shape
van = leg.legvander2d([x1], [x2], [1, 2])
assert_(van.shape == (1, 5, 6)) ```
Example 47
 Project: MARRtino-2.0   Author: DaniAffCH   File: test_legendre.py    GNU General Public License v3.0 5 votes
```def test_legvander2d(self):
# also tests polyval2d for non-square coefficient array
x1, x2, x3 = self.x
c = np.random.random((2, 3))
van = leg.legvander2d(x1, x2, [1, 2])
tgt = leg.legval2d(x1, x2, c)
res = np.dot(van, c.flat)
assert_almost_equal(res, tgt)

# check shape
van = leg.legvander2d([x1], [x2], [1, 2])
assert_(van.shape == (1, 5, 6)) ```
Example 48
```def test_legvander2d(self):
# also tests polyval2d for non-square coefficient array
x1, x2, x3 = self.x
c = np.random.random((2, 3))
van = leg.legvander2d(x1, x2, [1, 2])
tgt = leg.legval2d(x1, x2, c)
res = np.dot(van, c.flat)
assert_almost_equal(res, tgt)

# check shape
van = leg.legvander2d([x1], [x2], [1, 2])
assert_(van.shape == (1, 5, 6)) ```
Example 49
```def test_legvander2d(self):
# also tests polyval2d for non-square coefficient array
x1, x2, x3 = self.x
c = np.random.random((2, 3))
van = leg.legvander2d(x1, x2, [1, 2])
tgt = leg.legval2d(x1, x2, c)
res = np.dot(van, c.flat)
assert_almost_equal(res, tgt)

# check shape
van = leg.legvander2d([x1], [x2], [1, 2])
assert_(van.shape == (1, 5, 6)) ```
Example 50
```def test_legvander2d(self):
# also tests polyval2d for non-square coefficient array
x1, x2, x3 = self.x
c = np.random.random((2, 3))
van = leg.legvander2d(x1, x2, [1, 2])
tgt = leg.legval2d(x1, x2, c)
res = np.dot(van, c.flat)
assert_almost_equal(res, tgt)

# check shape
van = leg.legvander2d([x1], [x2], [1, 2])
assert_(van.shape == (1, 5, 6)) ```
Example 51
```def test_legvander2d(self) :
# also tests polyval2d for non-square coefficient array
x1, x2, x3 = self.x
c = np.random.random((2, 3))
van = leg.legvander2d(x1, x2, [1, 2])
tgt = leg.legval2d(x1, x2, c)
res = np.dot(van, c.flat)
assert_almost_equal(res, tgt)

# check shape
van = leg.legvander2d([x1], [x2], [1, 2])
assert_(van.shape == (1, 5, 6)) ```
Example 52
```def test_legvander2d(self):
# also tests polyval2d for non-square coefficient array
x1, x2, x3 = self.x
c = np.random.random((2, 3))
van = leg.legvander2d(x1, x2, [1, 2])
tgt = leg.legval2d(x1, x2, c)
res = np.dot(van, c.flat)
assert_almost_equal(res, tgt)

# check shape
van = leg.legvander2d([x1], [x2], [1, 2])
assert_(van.shape == (1, 5, 6)) ```
Example 53
```def test_legvander2d(self):
# also tests polyval2d for non-square coefficient array
x1, x2, x3 = self.x
c = np.random.random((2, 3))
van = leg.legvander2d(x1, x2, [1, 2])
tgt = leg.legval2d(x1, x2, c)
res = np.dot(van, c.flat)
assert_almost_equal(res, tgt)

# check shape
van = leg.legvander2d([x1], [x2], [1, 2])
assert_(van.shape == (1, 5, 6)) ```
Example 54
```def test_legvander2d(self):
# also tests polyval2d for non-square coefficient array
x1, x2, x3 = self.x
c = np.random.random((2, 3))
van = leg.legvander2d(x1, x2, [1, 2])
tgt = leg.legval2d(x1, x2, c)
res = np.dot(van, c.flat)
assert_almost_equal(res, tgt)

# check shape
van = leg.legvander2d([x1], [x2], [1, 2])
assert_(van.shape == (1, 5, 6)) ```
Example 55
 Project: 3dprinteros-client   Author: panasevychol   File: test_legendre.py    GNU Affero General Public License v3.0 5 votes
```def test_legvander2d(self):
# also tests polyval2d for non-square coefficient array
x1, x2, x3 = self.x
c = np.random.random((2, 3))
van = leg.legvander2d(x1, x2, [1, 2])
tgt = leg.legval2d(x1, x2, c)
res = np.dot(van, c.flat)
assert_almost_equal(res, tgt)

# check shape
van = leg.legvander2d([x1], [x2], [1, 2])
assert_(van.shape == (1, 5, 6)) ```
Example 56
 Project: 3dprinteros-client   Author: panasevychol   File: test_legendre.py    GNU Affero General Public License v3.0 5 votes
```def test_legvander2d(self):
# also tests polyval2d for non-square coefficient array
x1, x2, x3 = self.x
c = np.random.random((2, 3))
van = leg.legvander2d(x1, x2, [1, 2])
tgt = leg.legval2d(x1, x2, c)
res = np.dot(van, c.flat)
assert_almost_equal(res, tgt)

# check shape
van = leg.legvander2d([x1], [x2], [1, 2])
assert_(van.shape == (1, 5, 6)) ```
Example 57
```def test_legvander2d(self):
# also tests polyval2d for non-square coefficient array
x1, x2, x3 = self.x
c = np.random.random((2, 3))
van = leg.legvander2d(x1, x2, [1, 2])
tgt = leg.legval2d(x1, x2, c)
res = np.dot(van, c.flat)
assert_almost_equal(res, tgt)

# check shape
van = leg.legvander2d([x1], [x2], [1, 2])
assert_(van.shape == (1, 5, 6)) ```
Example 58
```def test_legvander2d(self):
# also tests polyval2d for non-square coefficient array
x1, x2, x3 = self.x
c = np.random.random((2, 3))
van = leg.legvander2d(x1, x2, [1, 2])
tgt = leg.legval2d(x1, x2, c)
res = np.dot(van, c.flat)
assert_almost_equal(res, tgt)

# check shape
van = leg.legvander2d([x1], [x2], [1, 2])
assert_(van.shape == (1, 5, 6)) ```
Example 59
```def test_legvander2d(self):
# also tests polyval2d for non-square coefficient array
x1, x2, x3 = self.x
c = np.random.random((2, 3))
van = leg.legvander2d(x1, x2, [1, 2])
tgt = leg.legval2d(x1, x2, c)
res = np.dot(van, c.flat)
assert_almost_equal(res, tgt)

# check shape
van = leg.legvander2d([x1], [x2], [1, 2])
assert_(van.shape == (1, 5, 6)) ```
Example 60
```def test_legvander2d(self):
# also tests polyval2d for non-square coefficient array
x1, x2, x3 = self.x
c = np.random.random((2, 3))
van = leg.legvander2d(x1, x2, [1, 2])
tgt = leg.legval2d(x1, x2, c)
res = np.dot(van, c.flat)
assert_almost_equal(res, tgt)

# check shape
van = leg.legvander2d([x1], [x2], [1, 2])
assert_(van.shape == (1, 5, 6)) ```
Example 61
```def test_legvander2d(self):
# also tests polyval2d for non-square coefficient array
x1, x2, x3 = self.x
c = np.random.random((2, 3))
van = leg.legvander2d(x1, x2, [1, 2])
tgt = leg.legval2d(x1, x2, c)
res = np.dot(van, c.flat)
assert_almost_equal(res, tgt)

# check shape
van = leg.legvander2d([x1], [x2], [1, 2])
assert_(van.shape == (1, 5, 6)) ```
Example 62
 Project: facethin   Author: ParkerGod   File: test_legendre.py    GNU General Public License v3.0 5 votes
```def test_legvander2d(self):
# also tests polyval2d for non-square coefficient array
x1, x2, x3 = self.x
c = np.random.random((2, 3))
van = leg.legvander2d(x1, x2, [1, 2])
tgt = leg.legval2d(x1, x2, c)
res = np.dot(van, c.flat)
assert_almost_equal(res, tgt)

# check shape
van = leg.legvander2d([x1], [x2], [1, 2])
assert_(van.shape == (1, 5, 6)) ```
Example 63
```def test_legvander2d(self):
# also tests polyval2d for non-square coefficient array
x1, x2, x3 = self.x
c = np.random.random((2, 3))
van = leg.legvander2d(x1, x2, [1, 2])
tgt = leg.legval2d(x1, x2, c)
res = np.dot(van, c.flat)
assert_almost_equal(res, tgt)

# check shape
van = leg.legvander2d([x1], [x2], [1, 2])
assert_(van.shape == (1, 5, 6)) ```
Example 64
```def test_legvander2d(self):
# also tests polyval2d for non-square coefficient array
x1, x2, x3 = self.x
c = np.random.random((2, 3))
van = leg.legvander2d(x1, x2, [1, 2])
tgt = leg.legval2d(x1, x2, c)
res = np.dot(van, c.flat)
assert_almost_equal(res, tgt)

# check shape
van = leg.legvander2d([x1], [x2], [1, 2])
assert_(van.shape == (1, 5, 6)) ```
Example 65
```def test_legvander2d(self):
# also tests polyval2d for non-square coefficient array
x1, x2, x3 = self.x
c = np.random.random((2, 3))
van = leg.legvander2d(x1, x2, [1, 2])
tgt = leg.legval2d(x1, x2, c)
res = np.dot(van, c.flat)
assert_almost_equal(res, tgt)

# check shape
van = leg.legvander2d([x1], [x2], [1, 2])
assert_(van.shape == (1, 5, 6)) ```
Example 66
```def test_legvander2d(self):
# also tests polyval2d for non-square coefficient array
x1, x2, x3 = self.x
c = np.random.random((2, 3))
van = leg.legvander2d(x1, x2, [1, 2])
tgt = leg.legval2d(x1, x2, c)
res = np.dot(van, c.flat)
assert_almost_equal(res, tgt)

# check shape
van = leg.legvander2d([x1], [x2], [1, 2])
assert_(van.shape == (1, 5, 6)) ```
Example 67
```def test_legvander2d(self):
# also tests polyval2d for non-square coefficient array
x1, x2, x3 = self.x
c = np.random.random((2, 3))
van = leg.legvander2d(x1, x2, [1, 2])
tgt = leg.legval2d(x1, x2, c)
res = np.dot(van, c.flat)
assert_almost_equal(res, tgt)

# check shape
van = leg.legvander2d([x1], [x2], [1, 2])
assert_(van.shape == (1, 5, 6)) ```
Example 68
 Project: linux-cross-gcc   Author: nmercier   File: test_legendre.py    BSD 3-Clause "New" or "Revised" License 5 votes
```def test_legvander2d(self):
# also tests polyval2d for non-square coefficient array
x1, x2, x3 = self.x
c = np.random.random((2, 3))
van = leg.legvander2d(x1, x2, [1, 2])
tgt = leg.legval2d(x1, x2, c)
res = np.dot(van, c.flat)
assert_almost_equal(res, tgt)

# check shape
van = leg.legvander2d([x1], [x2], [1, 2])
assert_(van.shape == (1, 5, 6)) ```
Example 69
```def test_legvander2d(self):
# also tests polyval2d for non-square coefficient array
x1, x2, x3 = self.x
c = np.random.random((2, 3))
van = leg.legvander2d(x1, x2, [1, 2])
tgt = leg.legval2d(x1, x2, c)
res = np.dot(van, c.flat)
assert_almost_equal(res, tgt)

# check shape
van = leg.legvander2d([x1], [x2], [1, 2])
assert_(van.shape == (1, 5, 6)) ```
Example 70
```def test_legvander2d(self):
# also tests polyval2d for non-square coefficient array
x1, x2, x3 = self.x
c = np.random.random((2, 3))
van = leg.legvander2d(x1, x2, [1, 2])
tgt = leg.legval2d(x1, x2, c)
res = np.dot(van, c.flat)
assert_almost_equal(res, tgt)

# check shape
van = leg.legvander2d([x1], [x2], [1, 2])
assert_(van.shape == (1, 5, 6)) ```
Example 71
```def test_legvander2d(self):
# also tests polyval2d for non-square coefficient array
x1, x2, x3 = self.x
c = np.random.random((2, 3))
van = leg.legvander2d(x1, x2, [1, 2])
tgt = leg.legval2d(x1, x2, c)
res = np.dot(van, c.flat)
assert_almost_equal(res, tgt)

# check shape
van = leg.legvander2d([x1], [x2], [1, 2])
assert_(van.shape == (1, 5, 6)) ```
Example 72
 Project: honours_project   Author: JFriel   File: test_legendre.py    GNU General Public License v3.0 5 votes
```def test_legvander2d(self):
# also tests polyval2d for non-square coefficient array
x1, x2, x3 = self.x
c = np.random.random((2, 3))
van = leg.legvander2d(x1, x2, [1, 2])
tgt = leg.legval2d(x1, x2, c)
res = np.dot(van, c.flat)
assert_almost_equal(res, tgt)

# check shape
van = leg.legvander2d([x1], [x2], [1, 2])
assert_(van.shape == (1, 5, 6)) ```
Example 73
 Project: honours_project   Author: JFriel   File: test_legendre.py    GNU General Public License v3.0 5 votes
```def test_legvander2d(self):
# also tests polyval2d for non-square coefficient array
x1, x2, x3 = self.x
c = np.random.random((2, 3))
van = leg.legvander2d(x1, x2, [1, 2])
tgt = leg.legval2d(x1, x2, c)
res = np.dot(van, c.flat)
assert_almost_equal(res, tgt)

# check shape
van = leg.legvander2d([x1], [x2], [1, 2])
assert_(van.shape == (1, 5, 6)) ```
Example 74
```def test_legvander2d(self):
# also tests polyval2d for non-square coefficient array
x1, x2, x3 = self.x
c = np.random.random((2, 3))
van = leg.legvander2d(x1, x2, [1, 2])
tgt = leg.legval2d(x1, x2, c)
res = np.dot(van, c.flat)
assert_almost_equal(res, tgt)

# check shape
van = leg.legvander2d([x1], [x2], [1, 2])
assert_(van.shape == (1, 5, 6)) ```
Example 75
 Project: PYPIC   Author: max614   File: test_legendre.py    BSD 2-Clause "Simplified" License 5 votes
```def test_legvander2d(self):
# also tests polyval2d for non-square coefficient array
x1, x2, x3 = self.x
c = np.random.random((2, 3))
van = leg.legvander2d(x1, x2, [1, 2])
tgt = leg.legval2d(x1, x2, c)
res = np.dot(van, c.flat)
assert_almost_equal(res, tgt)

# check shape
van = leg.legvander2d([x1], [x2], [1, 2])
assert_(van.shape == (1, 5, 6)) ```
Example 76
 Project: PYPIC   Author: max614   File: test_legendre.py    BSD 2-Clause "Simplified" License 5 votes
```def test_legvander2d(self):
# also tests polyval2d for non-square coefficient array
x1, x2, x3 = self.x
c = np.random.random((2, 3))
van = leg.legvander2d(x1, x2, [1, 2])
tgt = leg.legval2d(x1, x2, c)
res = np.dot(van, c.flat)
assert_almost_equal(res, tgt)

# check shape
van = leg.legvander2d([x1], [x2], [1, 2])
assert_(van.shape == (1, 5, 6)) ```
Example 77
 Project: offlow   Author: satwikkansal   File: test_legendre.py    GNU General Public License v3.0 5 votes
```def test_legvander2d(self):
# also tests polyval2d for non-square coefficient array
x1, x2, x3 = self.x
c = np.random.random((2, 3))
van = leg.legvander2d(x1, x2, [1, 2])
tgt = leg.legval2d(x1, x2, c)
res = np.dot(van, c.flat)
assert_almost_equal(res, tgt)

# check shape
van = leg.legvander2d([x1], [x2], [1, 2])
assert_(van.shape == (1, 5, 6)) ```
Example 78
 Project: lambda-tensorflow-object-detection   Author: mikylucky   File: test_legendre.py    GNU General Public License v3.0 5 votes
```def test_legvander2d(self):
# also tests polyval2d for non-square coefficient array
x1, x2, x3 = self.x
c = np.random.random((2, 3))
van = leg.legvander2d(x1, x2, [1, 2])
tgt = leg.legval2d(x1, x2, c)
res = np.dot(van, c.flat)
assert_almost_equal(res, tgt)

# check shape
van = leg.legvander2d([x1], [x2], [1, 2])
assert_(van.shape == (1, 5, 6)) ```
Example 79
 Project: elasticintel   Author: securityclippy   File: test_legendre.py    GNU General Public License v3.0 5 votes
```def test_legvander2d(self):
# also tests polyval2d for non-square coefficient array
x1, x2, x3 = self.x
c = np.random.random((2, 3))
van = leg.legvander2d(x1, x2, [1, 2])
tgt = leg.legval2d(x1, x2, c)
res = np.dot(van, c.flat)
assert_almost_equal(res, tgt)

# check shape
van = leg.legvander2d([x1], [x2], [1, 2])
assert_(van.shape == (1, 5, 6)) ```
Example 80
```def test_legvander2d(self):