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

The following are code examples for showing how to use numpy.polynomial.legendre.legtrim(). 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 trim(x):
return leg.legtrim(x, tol=1e-6) ```
Example 2
```def test_legtrim(self):
coef = [2, -1, 1, 0]

# Test exceptions
assert_raises(ValueError, leg.legtrim, coef, -1)

# Test results
assert_equal(leg.legtrim(coef), coef[:-1])
assert_equal(leg.legtrim(coef, 1), coef[:-3])
assert_equal(leg.legtrim(coef, 2), [0]) ```
Example 3
```def trim(x):
return leg.legtrim(x, tol=1e-6) ```
Example 4
```def test_legtrim(self):
coef = [2, -1, 1, 0]

# Test exceptions
assert_raises(ValueError, leg.legtrim, coef, -1)

# Test results
assert_equal(leg.legtrim(coef), coef[:-1])
assert_equal(leg.legtrim(coef, 1), coef[:-3])
assert_equal(leg.legtrim(coef, 2), [0]) ```
Example 5
```def trim(x):
return leg.legtrim(x, tol=1e-6) ```
Example 6
```def test_legtrim(self):
coef = [2, -1, 1, 0]

# Test exceptions
assert_raises(ValueError, leg.legtrim, coef, -1)

# Test results
assert_equal(leg.legtrim(coef), coef[:-1])
assert_equal(leg.legtrim(coef, 1), coef[:-3])
assert_equal(leg.legtrim(coef, 2), [0]) ```
Example 7
 Project: att   Author: Centre-Alt-Rendiment-Esportiu   File: test_legendre.py    GNU General Public License v3.0 5 votes
```def trim(x):
return leg.legtrim(x, tol=1e-6) ```
Example 8
 Project: att   Author: Centre-Alt-Rendiment-Esportiu   File: test_legendre.py    GNU General Public License v3.0 5 votes
```def test_legtrim(self):
coef = [2, -1, 1, 0]

# Test exceptions
assert_raises(ValueError, leg.legtrim, coef, -1)

# Test results
assert_equal(leg.legtrim(coef), coef[:-1])
assert_equal(leg.legtrim(coef, 1), coef[:-3])
assert_equal(leg.legtrim(coef, 2), [0]) ```
Example 9
```def trim(x):
return leg.legtrim(x, tol=1e-6) ```
Example 10
```def test_legtrim(self):
coef = [2, -1, 1, 0]

# Test exceptions
assert_raises(ValueError, leg.legtrim, coef, -1)

# Test results
assert_equal(leg.legtrim(coef), coef[:-1])
assert_equal(leg.legtrim(coef, 1), coef[:-3])
assert_equal(leg.legtrim(coef, 2), [0]) ```
Example 11
 Project: MARRtino-2.0   Author: DaniAffCH   File: test_legendre.py    GNU General Public License v3.0 5 votes
```def trim(x):
return leg.legtrim(x, tol=1e-6) ```
Example 12
 Project: MARRtino-2.0   Author: DaniAffCH   File: test_legendre.py    GNU General Public License v3.0 5 votes
```def test_legtrim(self):
coef = [2, -1, 1, 0]

# Test exceptions
assert_raises(ValueError, leg.legtrim, coef, -1)

# Test results
assert_equal(leg.legtrim(coef), coef[:-1])
assert_equal(leg.legtrim(coef, 1), coef[:-3])
assert_equal(leg.legtrim(coef, 2), [0]) ```
Example 13
```def trim(x):
return leg.legtrim(x, tol=1e-6) ```
Example 14
```def test_legtrim(self):
coef = [2, -1, 1, 0]

# Test exceptions
assert_raises(ValueError, leg.legtrim, coef, -1)

# Test results
assert_equal(leg.legtrim(coef), coef[:-1])
assert_equal(leg.legtrim(coef, 1), coef[:-3])
assert_equal(leg.legtrim(coef, 2), [0]) ```
Example 15
```def trim(x):
return leg.legtrim(x, tol=1e-6) ```
Example 16
```def test_legtrim(self):
coef = [2, -1, 1, 0]

# Test exceptions
assert_raises(ValueError, leg.legtrim, coef, -1)

# Test results
assert_equal(leg.legtrim(coef), coef[:-1])
assert_equal(leg.legtrim(coef, 1), coef[:-3])
assert_equal(leg.legtrim(coef, 2), [0]) ```
Example 17
```def trim(x):
return leg.legtrim(x, tol=1e-6) ```
Example 18
```def test_legtrim(self):
coef = [2, -1, 1, 0]

# Test exceptions
assert_raises(ValueError, leg.legtrim, coef, -1)

# Test results
assert_equal(leg.legtrim(coef), coef[:-1])
assert_equal(leg.legtrim(coef, 1), coef[:-3])
assert_equal(leg.legtrim(coef, 2), [0]) ```
Example 19
```def trim(x) :
return leg.legtrim(x, tol=1e-6) ```
Example 20
```def test_legtrim(self) :
coef = [2, -1, 1, 0]

# Test exceptions
assert_raises(ValueError, leg.legtrim, coef, -1)

# Test results
assert_equal(leg.legtrim(coef), coef[:-1])
assert_equal(leg.legtrim(coef, 1), coef[:-3])
assert_equal(leg.legtrim(coef, 2), [0]) ```
Example 21
```def trim(x):
return leg.legtrim(x, tol=1e-6) ```
Example 22
```def test_legtrim(self):
coef = [2, -1, 1, 0]

# Test exceptions
assert_raises(ValueError, leg.legtrim, coef, -1)

# Test results
assert_equal(leg.legtrim(coef), coef[:-1])
assert_equal(leg.legtrim(coef, 1), coef[:-3])
assert_equal(leg.legtrim(coef, 2), [0]) ```
Example 23
```def trim(x):
return leg.legtrim(x, tol=1e-6) ```
Example 24
```def test_legtrim(self):
coef = [2, -1, 1, 0]

# Test exceptions
assert_raises(ValueError, leg.legtrim, coef, -1)

# Test results
assert_equal(leg.legtrim(coef), coef[:-1])
assert_equal(leg.legtrim(coef, 1), coef[:-3])
assert_equal(leg.legtrim(coef, 2), [0]) ```
Example 25
```def trim(x):
return leg.legtrim(x, tol=1e-6) ```
Example 26
```def test_legtrim(self):
coef = [2, -1, 1, 0]

# Test exceptions
assert_raises(ValueError, leg.legtrim, coef, -1)

# Test results
assert_equal(leg.legtrim(coef), coef[:-1])
assert_equal(leg.legtrim(coef, 1), coef[:-3])
assert_equal(leg.legtrim(coef, 2), [0]) ```
Example 27
 Project: 3dprinteros-client   Author: panasevychol   File: test_legendre.py    GNU Affero General Public License v3.0 5 votes
```def trim(x):
return leg.legtrim(x, tol=1e-6) ```
Example 28
 Project: 3dprinteros-client   Author: panasevychol   File: test_legendre.py    GNU Affero General Public License v3.0 5 votes
```def test_legtrim(self):
coef = [2, -1, 1, 0]

# Test exceptions
assert_raises(ValueError, leg.legtrim, coef, -1)

# Test results
assert_equal(leg.legtrim(coef), coef[:-1])
assert_equal(leg.legtrim(coef, 1), coef[:-3])
assert_equal(leg.legtrim(coef, 2), [0]) ```
Example 29
 Project: 3dprinteros-client   Author: panasevychol   File: test_legendre.py    GNU Affero General Public License v3.0 5 votes
```def trim(x):
return leg.legtrim(x, tol=1e-6) ```
Example 30
 Project: 3dprinteros-client   Author: panasevychol   File: test_legendre.py    GNU Affero General Public License v3.0 5 votes
```def test_legtrim(self):
coef = [2, -1, 1, 0]

# Test exceptions
assert_raises(ValueError, leg.legtrim, coef, -1)

# Test results
assert_equal(leg.legtrim(coef), coef[:-1])
assert_equal(leg.legtrim(coef, 1), coef[:-3])
assert_equal(leg.legtrim(coef, 2), [0]) ```
Example 31
```def trim(x):
return leg.legtrim(x, tol=1e-6) ```
Example 32
```def test_legtrim(self):
coef = [2, -1, 1, 0]

# Test exceptions
assert_raises(ValueError, leg.legtrim, coef, -1)

# Test results
assert_equal(leg.legtrim(coef), coef[:-1])
assert_equal(leg.legtrim(coef, 1), coef[:-3])
assert_equal(leg.legtrim(coef, 2), [0]) ```
Example 33
```def trim(x):
return leg.legtrim(x, tol=1e-6) ```
Example 34
```def test_legtrim(self):
coef = [2, -1, 1, 0]

# Test exceptions
assert_raises(ValueError, leg.legtrim, coef, -1)

# Test results
assert_equal(leg.legtrim(coef), coef[:-1])
assert_equal(leg.legtrim(coef, 1), coef[:-3])
assert_equal(leg.legtrim(coef, 2), [0]) ```
Example 35
```def trim(x):
return leg.legtrim(x, tol=1e-6) ```
Example 36
```def test_legtrim(self):
coef = [2, -1, 1, 0]

# Test exceptions
assert_raises(ValueError, leg.legtrim, coef, -1)

# Test results
assert_equal(leg.legtrim(coef), coef[:-1])
assert_equal(leg.legtrim(coef, 1), coef[:-3])
assert_equal(leg.legtrim(coef, 2), [0]) ```
Example 37
```def trim(x):
return leg.legtrim(x, tol=1e-6) ```
Example 38
```def test_legtrim(self):
coef = [2, -1, 1, 0]

# Test exceptions
assert_raises(ValueError, leg.legtrim, coef, -1)

# Test results
assert_equal(leg.legtrim(coef), coef[:-1])
assert_equal(leg.legtrim(coef, 1), coef[:-3])
assert_equal(leg.legtrim(coef, 2), [0]) ```
Example 39
```def trim(x):
return leg.legtrim(x, tol=1e-6) ```
Example 40
```def test_legtrim(self):
coef = [2, -1, 1, 0]

# Test exceptions
assert_raises(ValueError, leg.legtrim, coef, -1)

# Test results
assert_equal(leg.legtrim(coef), coef[:-1])
assert_equal(leg.legtrim(coef, 1), coef[:-3])
assert_equal(leg.legtrim(coef, 2), [0]) ```
Example 41
 Project: facethin   Author: ParkerGod   File: test_legendre.py    GNU General Public License v3.0 5 votes
```def trim(x):
return leg.legtrim(x, tol=1e-6) ```
Example 42
 Project: facethin   Author: ParkerGod   File: test_legendre.py    GNU General Public License v3.0 5 votes
```def test_legtrim(self):
coef = [2, -1, 1, 0]

# Test exceptions
assert_raises(ValueError, leg.legtrim, coef, -1)

# Test results
assert_equal(leg.legtrim(coef), coef[:-1])
assert_equal(leg.legtrim(coef, 1), coef[:-3])
assert_equal(leg.legtrim(coef, 2), [0]) ```
Example 43
```def trim(x):
return leg.legtrim(x, tol=1e-6) ```
Example 44
```def test_legtrim(self):
coef = [2, -1, 1, 0]

# Test exceptions
assert_raises(ValueError, leg.legtrim, coef, -1)

# Test results
assert_equal(leg.legtrim(coef), coef[:-1])
assert_equal(leg.legtrim(coef, 1), coef[:-3])
assert_equal(leg.legtrim(coef, 2), [0]) ```
Example 45
```def trim(x):
return leg.legtrim(x, tol=1e-6) ```
Example 46
```def test_legtrim(self):
coef = [2, -1, 1, 0]

# Test exceptions
assert_raises(ValueError, leg.legtrim, coef, -1)

# Test results
assert_equal(leg.legtrim(coef), coef[:-1])
assert_equal(leg.legtrim(coef, 1), coef[:-3])
assert_equal(leg.legtrim(coef, 2), [0]) ```
Example 47
```def trim(x):
return leg.legtrim(x, tol=1e-6) ```
Example 48
```def test_legtrim(self):
coef = [2, -1, 1, 0]

# Test exceptions
assert_raises(ValueError, leg.legtrim, coef, -1)

# Test results
assert_equal(leg.legtrim(coef), coef[:-1])
assert_equal(leg.legtrim(coef, 1), coef[:-3])
assert_equal(leg.legtrim(coef, 2), [0]) ```
Example 49
```def trim(x):
return leg.legtrim(x, tol=1e-6) ```
Example 50
```def test_legtrim(self):
coef = [2, -1, 1, 0]

# Test exceptions
assert_raises(ValueError, leg.legtrim, coef, -1)

# Test results
assert_equal(leg.legtrim(coef), coef[:-1])
assert_equal(leg.legtrim(coef, 1), coef[:-3])
assert_equal(leg.legtrim(coef, 2), [0]) ```
Example 51
```def trim(x):
return leg.legtrim(x, tol=1e-6) ```
Example 52
```def test_legtrim(self):
coef = [2, -1, 1, 0]

# Test exceptions
assert_raises(ValueError, leg.legtrim, coef, -1)

# Test results
assert_equal(leg.legtrim(coef), coef[:-1])
assert_equal(leg.legtrim(coef, 1), coef[:-3])
assert_equal(leg.legtrim(coef, 2), [0]) ```
Example 53
 Project: linux-cross-gcc   Author: nmercier   File: test_legendre.py    BSD 3-Clause "New" or "Revised" License 5 votes
```def trim(x):
return leg.legtrim(x, tol=1e-6) ```
Example 54
 Project: linux-cross-gcc   Author: nmercier   File: test_legendre.py    BSD 3-Clause "New" or "Revised" License 5 votes
```def test_legtrim(self):
coef = [2, -1, 1, 0]

# Test exceptions
assert_raises(ValueError, leg.legtrim, coef, -1)

# Test results
assert_equal(leg.legtrim(coef), coef[:-1])
assert_equal(leg.legtrim(coef, 1), coef[:-3])
assert_equal(leg.legtrim(coef, 2), [0]) ```
Example 55
```def trim(x):
return leg.legtrim(x, tol=1e-6) ```
Example 56
```def test_legtrim(self):
coef = [2, -1, 1, 0]

# Test exceptions
assert_raises(ValueError, leg.legtrim, coef, -1)

# Test results
assert_equal(leg.legtrim(coef), coef[:-1])
assert_equal(leg.legtrim(coef, 1), coef[:-3])
assert_equal(leg.legtrim(coef, 2), [0]) ```
Example 57
```def trim(x):
return leg.legtrim(x, tol=1e-6) ```
Example 58
```def test_legtrim(self):
coef = [2, -1, 1, 0]

# Test exceptions
assert_raises(ValueError, leg.legtrim, coef, -1)

# Test results
assert_equal(leg.legtrim(coef), coef[:-1])
assert_equal(leg.legtrim(coef, 1), coef[:-3])
assert_equal(leg.legtrim(coef, 2), [0]) ```
Example 59
```def trim(x):
return leg.legtrim(x, tol=1e-6) ```
Example 60
```def test_legtrim(self):
coef = [2, -1, 1, 0]

# Test exceptions
assert_raises(ValueError, leg.legtrim, coef, -1)

# Test results
assert_equal(leg.legtrim(coef), coef[:-1])
assert_equal(leg.legtrim(coef, 1), coef[:-3])
assert_equal(leg.legtrim(coef, 2), [0]) ```
Example 61
 Project: honours_project   Author: JFriel   File: test_legendre.py    GNU General Public License v3.0 5 votes
```def trim(x):
return leg.legtrim(x, tol=1e-6) ```
Example 62
 Project: honours_project   Author: JFriel   File: test_legendre.py    GNU General Public License v3.0 5 votes
```def test_legtrim(self):
coef = [2, -1, 1, 0]

# Test exceptions
assert_raises(ValueError, leg.legtrim, coef, -1)

# Test results
assert_equal(leg.legtrim(coef), coef[:-1])
assert_equal(leg.legtrim(coef, 1), coef[:-3])
assert_equal(leg.legtrim(coef, 2), [0]) ```
Example 63
 Project: honours_project   Author: JFriel   File: test_legendre.py    GNU General Public License v3.0 5 votes
```def trim(x):
return leg.legtrim(x, tol=1e-6) ```
Example 64
 Project: honours_project   Author: JFriel   File: test_legendre.py    GNU General Public License v3.0 5 votes
```def test_legtrim(self):
coef = [2, -1, 1, 0]

# Test exceptions
assert_raises(ValueError, leg.legtrim, coef, -1)

# Test results
assert_equal(leg.legtrim(coef), coef[:-1])
assert_equal(leg.legtrim(coef, 1), coef[:-3])
assert_equal(leg.legtrim(coef, 2), [0]) ```
Example 65
```def trim(x):
return leg.legtrim(x, tol=1e-6) ```
Example 66
```def test_legtrim(self):
coef = [2, -1, 1, 0]

# Test exceptions
assert_raises(ValueError, leg.legtrim, coef, -1)

# Test results
assert_equal(leg.legtrim(coef), coef[:-1])
assert_equal(leg.legtrim(coef, 1), coef[:-3])
assert_equal(leg.legtrim(coef, 2), [0]) ```
Example 67
 Project: PYPIC   Author: max614   File: test_legendre.py    BSD 2-Clause "Simplified" License 5 votes
```def trim(x):
return leg.legtrim(x, tol=1e-6) ```
Example 68
 Project: PYPIC   Author: max614   File: test_legendre.py    BSD 2-Clause "Simplified" License 5 votes
```def test_legtrim(self):
coef = [2, -1, 1, 0]

# Test exceptions
assert_raises(ValueError, leg.legtrim, coef, -1)

# Test results
assert_equal(leg.legtrim(coef), coef[:-1])
assert_equal(leg.legtrim(coef, 1), coef[:-3])
assert_equal(leg.legtrim(coef, 2), [0]) ```
Example 69
 Project: PYPIC   Author: max614   File: test_legendre.py    BSD 2-Clause "Simplified" License 5 votes
```def trim(x):
return leg.legtrim(x, tol=1e-6) ```
Example 70
 Project: PYPIC   Author: max614   File: test_legendre.py    BSD 2-Clause "Simplified" License 5 votes
```def test_legtrim(self):
coef = [2, -1, 1, 0]

# Test exceptions
assert_raises(ValueError, leg.legtrim, coef, -1)

# Test results
assert_equal(leg.legtrim(coef), coef[:-1])
assert_equal(leg.legtrim(coef, 1), coef[:-3])
assert_equal(leg.legtrim(coef, 2), [0]) ```
Example 71
 Project: PYPIC   Author: max614   File: test_legendre.py    BSD 2-Clause "Simplified" License 5 votes
```def trim(x):
return leg.legtrim(x, tol=1e-6) ```
Example 72
 Project: senior-design   Author: james-tate   File: test_legendre.py    GNU General Public License v2.0 5 votes
```def trim(x) :
return leg.legtrim(x, tol=1e-6) ```
Example 73
 Project: senior-design   Author: james-tate   File: test_legendre.py    GNU General Public License v2.0 5 votes
```def test_legtrim(self) :
coef = [2, -1, 1, 0]

# Test exceptions
assert_raises(ValueError, leg.legtrim, coef, -1)

# Test results
assert_equal(leg.legtrim(coef), coef[:-1])
assert_equal(leg.legtrim(coef, 1), coef[:-3])
assert_equal(leg.legtrim(coef, 2), [0]) ```
Example 74
 Project: offlow   Author: satwikkansal   File: test_legendre.py    GNU General Public License v3.0 5 votes
```def trim(x):
return leg.legtrim(x, tol=1e-6) ```
Example 75
 Project: offlow   Author: satwikkansal   File: test_legendre.py    GNU General Public License v3.0 5 votes
```def test_legtrim(self):
coef = [2, -1, 1, 0]

# Test exceptions
assert_raises(ValueError, leg.legtrim, coef, -1)

# Test results
assert_equal(leg.legtrim(coef), coef[:-1])
assert_equal(leg.legtrim(coef, 1), coef[:-3])
assert_equal(leg.legtrim(coef, 2), [0]) ```
Example 76
 Project: lambda-tensorflow-object-detection   Author: mikylucky   File: test_legendre.py    GNU General Public License v3.0 5 votes
```def trim(x):
return leg.legtrim(x, tol=1e-6) ```
Example 77
 Project: lambda-tensorflow-object-detection   Author: mikylucky   File: test_legendre.py    GNU General Public License v3.0 5 votes
```def test_legtrim(self):
coef = [2, -1, 1, 0]

# Test exceptions
assert_raises(ValueError, leg.legtrim, coef, -1)

# Test results
assert_equal(leg.legtrim(coef), coef[:-1])
assert_equal(leg.legtrim(coef, 1), coef[:-3])
assert_equal(leg.legtrim(coef, 2), [0]) ```
Example 78
 Project: elasticintel   Author: securityclippy   File: test_legendre.py    GNU General Public License v3.0 5 votes
```def trim(x):
return leg.legtrim(x, tol=1e-6) ```
Example 79
 Project: elasticintel   Author: securityclippy   File: test_legendre.py    GNU General Public License v3.0 5 votes
```def test_legtrim(self):
coef = [2, -1, 1, 0]

# Test exceptions
assert_raises(ValueError, leg.legtrim, coef, -1)

# Test results
assert_equal(leg.legtrim(coef), coef[:-1])
assert_equal(leg.legtrim(coef, 1), coef[:-3])
assert_equal(leg.legtrim(coef, 2), [0]) ```
Example 80
```def trim(x):