Thanks all,
I will use alltrue and allclose as Alex and Robert point out..
Cheers,
pujo
--
http://mail.python.org/mailman/listinfo/python-list
[EMAIL PROTECTED] wrote:
> Sorry Peter,
> Try this
>
> import unittest
> import Numeric
>
> class myTest(unittest.TestCase):
> def runTest(self):
> var1 = Numeric.array([1,22])
> var2 = Numeric.array([1,33])
> self.assertEqual(var1,var2)
>
> if __name__ == '__main
* Alex Martelli <[EMAIL PROTECTED]>:
> [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote:
>
> > Sorry Peter,
> >
> > Try this
> >
> > import unittest
> > import Numeric
> >
> > class myTest(unittest.TestCase):
> > def runTest(self):
> > var1 = Numeric.array([1,22])
> > var2 =
Alex Martelli wrote:
import Numeric
a=Numeric.array([1,22])
b=Numeric.array([1,33])
c = a==b
c
>
> array([1, 0])
>
assert(c)
>
> i.e., thanks to element-by-element evaluation, == will generally return
> a true value for ANY comparison of Numeric arrays, causing a very
>
[EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote:
> Sorry Peter,
>
> Try this
>
> import unittest
> import Numeric
>
> class myTest(unittest.TestCase):
> def runTest(self):
> var1 = Numeric.array([1,22])
> var2 = Numeric.array([1,33])
> self.assertEqual(var1,var2)
>
[EMAIL PROTECTED] wrote:
> hello,
>
> I found that if I use Numeric.array into unittest it is not
> consistance,
> Is that normal ?
>
> import Numeric
> class myTest(unittest.TestCase):
> def runTest(self):
> a = Numeric.array([1,2])
> b = Numeric.array([1,33])
> self.
Sorry Peter,
Try this
import unittest
import Numeric
class myTest(unittest.TestCase):
def runTest(self):
var1 = Numeric.array([1,22])
var2 = Numeric.array([1,33])
self.assertEqual(var1,var2)
if __name__ == '__main__':
unittest.main()
pujo
--
http://ma
[EMAIL PROTECTED] wrote:
> hello,
>
> I found that if I use Numeric.array into unittest it is not
> consistance,
> Is that normal ?
>
> import Numeric
> class myTest(unittest.TestCase):
> def runTest(self):
> a = Numeric.array([1,2])
> b = Numeric.array([1,33])
> self.
hello,
I found that if I use Numeric.array into unittest it is not
consistance,
Is that normal ?
import Numeric
class myTest(unittest.TestCase):
def runTest(self):
a = Numeric.array([1,2])
b = Numeric.array([1,33])
self.assertEqual(a, b)
pass
This will not raise