Detail: Batch: Operator Binary

Overview: Batch: Operator Binary

Batch.__add__(other)
>>> bt = sf.Batch((('i', sf.Frame(np.arange(6).reshape(3,2), index=('p', 'q', 'r'), columns=('a', 'b'), name='x')), ('j', sf.Frame(np.arange(40, 46).reshape(3,2), index=('p', 'q', 'r'), columns=('a', 'b'), name='v'))))
>>> (bt + 8).to_frame()
<Frame>
<Index>                a       b       <<U1>
<IndexHierarchy>
i                p     8       9
i                q     10      11
i                r     12      13
j                p     48      49
j                q     50      51
j                r     52      53
<<U1>            <<U1> <int64> <int64>
Batch.__and__(other)
>>> bt = sf.Batch((('i', sf.Frame((np.arange(6).reshape(3,2) % 2).astype(bool), index=('p', 'q', 'r'), columns=('c', 'd'), name='y')), ('j', sf.Frame((np.arange(6).reshape(3,2) % 3).astype(bool), index=('p', 'q', 'r'), columns=('c', 'd'), name='w'))))
>>> (bt & True).to_frame()
<Frame>
<Index>                c      d      <<U1>
<IndexHierarchy>
i                p     False  True
i                q     False  True
i                r     False  True
j                p     False  True
j                q     True   False
j                r     True   True
<<U1>            <<U1> <bool> <bool>
Batch.__eq__(other)

Return self==value.

>>> bt = sf.Batch((('i', sf.Frame(np.arange(6).reshape(3,2), index=('p', 'q', 'r'), columns=('a', 'b'), name='x')), ('j', sf.Frame(np.arange(40, 46).reshape(3,2), index=('p', 'q', 'r'), columns=('a', 'b'), name='v'))))
>>> (bt == 8).to_frame()
<Frame>
<Index>                a      b      <<U1>
<IndexHierarchy>
i                p     False  False
i                q     False  False
i                r     False  False
j                p     False  False
j                q     False  False
j                r     False  False
<<U1>            <<U1> <bool> <bool>
Batch.__floordiv__(other)
>>> bt = sf.Batch((('i', sf.Frame(np.arange(6).reshape(3,2), index=('p', 'q', 'r'), columns=('a', 'b'), name='x')), ('j', sf.Frame(np.arange(40, 46).reshape(3,2), index=('p', 'q', 'r'), columns=('a', 'b'), name='v'))))
>>> (bt // 8).to_frame()
<Frame>
<Index>                a       b       <<U1>
<IndexHierarchy>
i                p     0       0
i                q     0       0
i                r     0       0
j                p     5       5
j                q     5       5
j                r     5       5
<<U1>            <<U1> <int64> <int64>
Batch.__ge__(other)

Return self>=value.

>>> bt = sf.Batch((('i', sf.Frame(np.arange(6).reshape(3,2), index=('p', 'q', 'r'), columns=('a', 'b'), name='x')), ('j', sf.Frame(np.arange(40, 46).reshape(3,2), index=('p', 'q', 'r'), columns=('a', 'b'), name='v'))))
>>> (bt >= 8).to_frame()
<Frame>
<Index>                a      b      <<U1>
<IndexHierarchy>
i                p     False  False
i                q     False  False
i                r     False  False
j                p     True   True
j                q     True   True
j                r     True   True
<<U1>            <<U1> <bool> <bool>
Batch.__gt__(other)

Return self>value.

>>> bt = sf.Batch((('i', sf.Frame(np.arange(6).reshape(3,2), index=('p', 'q', 'r'), columns=('a', 'b'), name='x')), ('j', sf.Frame(np.arange(40, 46).reshape(3,2), index=('p', 'q', 'r'), columns=('a', 'b'), name='v'))))
>>> (bt > 8).to_frame()
<Frame>
<Index>                a      b      <<U1>
<IndexHierarchy>
i                p     False  False
i                q     False  False
i                r     False  False
j                p     True   True
j                q     True   True
j                r     True   True
<<U1>            <<U1> <bool> <bool>
Batch.__le__(other)

Return self<=value.

>>> bt = sf.Batch((('i', sf.Frame(np.arange(6).reshape(3,2), index=('p', 'q', 'r'), columns=('a', 'b'), name='x')), ('j', sf.Frame(np.arange(40, 46).reshape(3,2), index=('p', 'q', 'r'), columns=('a', 'b'), name='v'))))
>>> (bt <= 8).to_frame()
<Frame>
<Index>                a      b      <<U1>
<IndexHierarchy>
i                p     True   True
i                q     True   True
i                r     True   True
j                p     False  False
j                q     False  False
j                r     False  False
<<U1>            <<U1> <bool> <bool>
Batch.__lt__(other)

Return self<value.

>>> bt = sf.Batch((('i', sf.Frame(np.arange(6).reshape(3,2), index=('p', 'q', 'r'), columns=('a', 'b'), name='x')), ('j', sf.Frame(np.arange(40, 46).reshape(3,2), index=('p', 'q', 'r'), columns=('a', 'b'), name='v'))))
>>> (bt < 8).to_frame()
<Frame>
<Index>                a      b      <<U1>
<IndexHierarchy>
i                p     True   True
i                q     True   True
i                r     True   True
j                p     False  False
j                q     False  False
j                r     False  False
<<U1>            <<U1> <bool> <bool>
Batch.__matmul__(other)
>>> bt = sf.Batch((('i', sf.Frame(np.arange(6).reshape(3,2), index=('p', 'q', 'r'), columns=('a', 'b'), name='x')), ('j', sf.Frame(np.arange(40, 46).reshape(3,2), index=('p', 'q', 'r'), columns=('a', 'b'), name='v'))))
>>> (bt @ (1, 0.5)).to_frame()
<Frame>
<Index> p         q         r         <<U1>
<Index>
i       0.5       3.5       6.5
j       60.5      63.5      66.5
<<U1>   <float64> <float64> <float64>
Batch.__mod__(other)
>>> bt = sf.Batch((('i', sf.Frame(np.arange(6).reshape(3,2), index=('p', 'q', 'r'), columns=('a', 'b'), name='x')), ('j', sf.Frame(np.arange(40, 46).reshape(3,2), index=('p', 'q', 'r'), columns=('a', 'b'), name='v'))))
>>> (bt % 8).to_frame()
<Frame>
<Index>                a       b       <<U1>
<IndexHierarchy>
i                p     0       1
i                q     2       3
i                r     4       5
j                p     0       1
j                q     2       3
j                r     4       5
<<U1>            <<U1> <int64> <int64>
Batch.__mul__(other)
>>> bt = sf.Batch((('i', sf.Frame(np.arange(6).reshape(3,2), index=('p', 'q', 'r'), columns=('a', 'b'), name='x')), ('j', sf.Frame(np.arange(40, 46).reshape(3,2), index=('p', 'q', 'r'), columns=('a', 'b'), name='v'))))
>>> (bt * 8).to_frame()
<Frame>
<Index>                a       b       <<U1>
<IndexHierarchy>
i                p     0       8
i                q     16      24
i                r     32      40
j                p     320     328
j                q     336     344
j                r     352     360
<<U1>            <<U1> <int64> <int64>
Batch.__ne__(other)

Return self!=value.

>>> bt = sf.Batch((('i', sf.Frame(np.arange(6).reshape(3,2), index=('p', 'q', 'r'), columns=('a', 'b'), name='x')), ('j', sf.Frame(np.arange(40, 46).reshape(3,2), index=('p', 'q', 'r'), columns=('a', 'b'), name='v'))))
>>> (bt != 8).to_frame()
<Frame>
<Index>                a      b      <<U1>
<IndexHierarchy>
i                p     True   True
i                q     True   True
i                r     True   True
j                p     True   True
j                q     True   True
j                r     True   True
<<U1>            <<U1> <bool> <bool>
Batch.__or__(other)

Return self|value.

>>> bt = sf.Batch((('i', sf.Frame((np.arange(6).reshape(3,2) % 2).astype(bool), index=('p', 'q', 'r'), columns=('c', 'd'), name='y')), ('j', sf.Frame((np.arange(6).reshape(3,2) % 3).astype(bool), index=('p', 'q', 'r'), columns=('c', 'd'), name='w'))))
>>> (bt | True).to_frame()
<Frame>
<Index>                c      d      <<U1>
<IndexHierarchy>
i                p     True   True
i                q     True   True
i                r     True   True
j                p     True   True
j                q     True   True
j                r     True   True
<<U1>            <<U1> <bool> <bool>
Batch.__pow__(other)
>>> bt = sf.Batch((('i', sf.Frame(np.arange(6).reshape(3,2), index=('p', 'q', 'r'), columns=('a', 'b'), name='x')), ('j', sf.Frame(np.arange(40, 46).reshape(3,2), index=('p', 'q', 'r'), columns=('a', 'b'), name='v'))))
>>> (bt ** 8).to_frame()
<Frame>
<Index>                a              b              <<U1>
<IndexHierarchy>
i                p     0              1
i                q     256            6561
i                r     65536          390625
j                p     6553600000000  7984925229121
j                q     9682651996416  11688200277601
j                r     14048223625216 16815125390625
<<U1>            <<U1> <int64>        <int64>
Batch.__radd__(other)
>>> bt = sf.Batch((('i', sf.Frame(np.arange(6).reshape(3,2), index=('p', 'q', 'r'), columns=('a', 'b'), name='x')), ('j', sf.Frame(np.arange(40, 46).reshape(3,2), index=('p', 'q', 'r'), columns=('a', 'b'), name='v'))))
>>> (8 + bt).to_frame()
<Frame>
<Index>                a       b       <<U1>
<IndexHierarchy>
i                p     8       9
i                q     10      11
i                r     12      13
j                p     48      49
j                q     50      51
j                r     52      53
<<U1>            <<U1> <int64> <int64>
Batch.__rfloordiv__(other)
>>> bt = sf.Batch((('i', sf.Frame(np.arange(6).reshape(3,2), index=('p', 'q', 'r'), columns=('a', 'b'), name='x')), ('j', sf.Frame(np.arange(40, 46).reshape(3,2), index=('p', 'q', 'r'), columns=('a', 'b'), name='v'))))
>>> (8 // bt).to_frame()
<Frame>
<Index>                a       b       <<U1>
<IndexHierarchy>
i                p     0       8
i                q     4       2
i                r     2       1
j                p     0       0
j                q     0       0
j                r     0       0
<<U1>            <<U1> <int64> <int64>
Batch.__rmatmul__(other)
>>> bt = sf.Batch((('i', sf.Frame(np.arange(6).reshape(3,2), index=('p', 'q', 'r'), columns=('a', 'b'), name='x')), ('j', sf.Frame(np.arange(40, 46).reshape(3,2), index=('p', 'q', 'r'), columns=('a', 'b'), name='v'))))
>>> (bt @ (1, 0.5)).to_frame()
<Frame>
<Index> p         q         r         <<U1>
<Index>
i       0.5       3.5       6.5
j       60.5      63.5      66.5
<<U1>   <float64> <float64> <float64>
Batch.__rmul__(other)
>>> bt = sf.Batch((('i', sf.Frame(np.arange(6).reshape(3,2), index=('p', 'q', 'r'), columns=('a', 'b'), name='x')), ('j', sf.Frame(np.arange(40, 46).reshape(3,2), index=('p', 'q', 'r'), columns=('a', 'b'), name='v'))))
>>> (8 * bt).to_frame()
<Frame>
<Index>                a       b       <<U1>
<IndexHierarchy>
i                p     0       8
i                q     16      24
i                r     32      40
j                p     320     328
j                q     336     344
j                r     352     360
<<U1>            <<U1> <int64> <int64>
Batch.__rshift__(other)
>>> bt = sf.Batch((('i', sf.Frame(np.arange(6).reshape(3,2), index=('p', 'q', 'r'), columns=('a', 'b'), name='x')), ('j', sf.Frame(np.arange(40, 46).reshape(3,2), index=('p', 'q', 'r'), columns=('a', 'b'), name='v'))))
>>> (bt >> 1).to_frame()
<Frame>
<Index>                a       b       <<U1>
<IndexHierarchy>
i                p     0       0
i                q     1       1
i                r     2       2
j                p     20      20
j                q     21      21
j                r     22      22
<<U1>            <<U1> <int64> <int64>
Batch.__rsub__(other)
>>> bt = sf.Batch((('i', sf.Frame(np.arange(6).reshape(3,2), index=('p', 'q', 'r'), columns=('a', 'b'), name='x')), ('j', sf.Frame(np.arange(40, 46).reshape(3,2), index=('p', 'q', 'r'), columns=('a', 'b'), name='v'))))
>>> (8 - bt).to_frame()
<Frame>
<Index>                a       b       <<U1>
<IndexHierarchy>
i                p     8       7
i                q     6       5
i                r     4       3
j                p     -32     -33
j                q     -34     -35
j                r     -36     -37
<<U1>            <<U1> <int64> <int64>
Batch.__rtruediv__(other)
>>> bt = sf.Batch((('i', sf.Frame(np.arange(6).reshape(3,2), index=('p', 'q', 'r'), columns=('a', 'b'), name='x')), ('j', sf.Frame(np.arange(40, 46).reshape(3,2), index=('p', 'q', 'r'), columns=('a', 'b'), name='v'))))
>>> (8 / bt).to_frame()
<Frame>
<Index>                a                   b                   <<U1>
<IndexHierarchy>
i                p     inf                 8.0
i                q     4.0                 2.6666666666666665
i                r     2.0                 1.6
j                p     0.2                 0.1951219512195122
j                q     0.19047619047619047 0.18604651162790697
j                r     0.18181818181818182 0.17777777777777778
<<U1>            <<U1> <float64>           <float64>
Batch.__sub__(other)
>>> bt = sf.Batch((('i', sf.Frame(np.arange(6).reshape(3,2), index=('p', 'q', 'r'), columns=('a', 'b'), name='x')), ('j', sf.Frame(np.arange(40, 46).reshape(3,2), index=('p', 'q', 'r'), columns=('a', 'b'), name='v'))))
>>> (bt - 8).to_frame()
<Frame>
<Index>                a       b       <<U1>
<IndexHierarchy>
i                p     -8      -7
i                q     -6      -5
i                r     -4      -3
j                p     32      33
j                q     34      35
j                r     36      37
<<U1>            <<U1> <int64> <int64>
Batch.__truediv__(other)
>>> bt = sf.Batch((('i', sf.Frame(np.arange(6).reshape(3,2), index=('p', 'q', 'r'), columns=('a', 'b'), name='x')), ('j', sf.Frame(np.arange(40, 46).reshape(3,2), index=('p', 'q', 'r'), columns=('a', 'b'), name='v'))))
>>> (bt / 8).to_frame()
<Frame>
<Index>                a         b         <<U1>
<IndexHierarchy>
i                p     0.0       0.125
i                q     0.25      0.375
i                r     0.5       0.625
j                p     5.0       5.125
j                q     5.25      5.375
j                r     5.5       5.625
<<U1>            <<U1> <float64> <float64>
Batch.__xor__(other)
>>> bt = sf.Batch((('i', sf.Frame((np.arange(6).reshape(3,2) % 2).astype(bool), index=('p', 'q', 'r'), columns=('c', 'd'), name='y')), ('j', sf.Frame((np.arange(6).reshape(3,2) % 3).astype(bool), index=('p', 'q', 'r'), columns=('c', 'd'), name='w'))))
>>> (bt ^ True).to_frame()
<Frame>
<Index>                c      d      <<U1>
<IndexHierarchy>
i                p     True   False
i                q     True   False
i                r     True   False
j                p     True   False
j                q     False  True
j                r     False  False
<<U1>            <<U1> <bool> <bool>

Batch: Constructor | Exporter | Attribute | Method | Dictionary-Like | Display | Selector | Operator Binary | Operator Unary | Accessor Values | Accessor Datetime | Accessor String | Accessor Transpose | Accessor Fill Value | Accessor Regular Expression | Accessor Hashlib | Accessor Type Clinic