Did I find the right examples for you? yes no      Crawl my project      Python Jobs

# cogent.maths.matrix.distance.DistanceMatrix.elementPow

All Samples(10)  |  Call(10)  |  Derive(0)  |  Import(0)

```            dm = DistanceMatrix(data=n, RowOrder=n.keys(),ColOrder=n.keys(),\
dm.elementPow(2)
self.assertEqual(dm.Power, 2)
self.assertEqual(dm['A']['A'],m['A']['A']**2)
```
```            dm = DistanceMatrix(data=n, RowOrder=n.keys(),ColOrder=n.keys(),\
dm.elementPow(3)
dm.elementPow(1./2.)
self.assertEqual(dm.Power, 3./2.)
```
```                    Pad=False)
dm['A']['A'] = 'p'
dm.elementPow(2)
self.assertEqual(dm.Power, 2.)
self.assertEqual(dm['A']['A'],'p')
```
```                    Pad=False)
dm['A']['A'] = None
dm.elementPow(2)
self.assertEqual(dm.Power, 2.)
self.assertEqual(dm['A']['A'],None)
```

```            dm = DistanceMatrix(data=n, RowOrder=n.keys(),ColOrder=n.keys(),\
dm.elementPow(2)
self.assertEqual(dm.Power, 2)
self.assertEqual(dm['A']['A'],m['A']['A']**2)
```
```            dm = DistanceMatrix(data=n, RowOrder=n.keys(),ColOrder=n.keys(),\
dm.elementPow(3)
dm.elementPow(1./2.)
self.assertEqual(dm.Power, 3./2.)
```
```                    Pad=False)
dm['A']['A'] = 'p'
dm.elementPow(2)
self.assertEqual(dm.Power, 2.)
self.assertEqual(dm['A']['A'],'p')
```
```                    Pad=False)
dm['A']['A'] = None
dm.elementPow(2)
self.assertEqual(dm.Power, 2.)
self.assertEqual(dm['A']['A'],None)
```