The release notes: http://github.com/kwgoodman/la/blob/master/RELEASE.rst
The focus of this release was binary operations between unaligned
larrys with user control of the join method (five available) and the
fill method. A general binary function, la.binaryop(), was added as
were the convenience functions add, subtract, multiply, divide.
Supporting functions such as la.align(), which aligns two larrys, were
also added.
A demo of la.add():
Create two larrys:
>>> from la import nan
>>> lar1 = larry([1, 2, nan], [['a', 'b', 'c']])
>>> lar2 = larry([1, nan, nan], [['a', 'b', 'dd']])
The default is an inner join (note that lar1 and lar2 have two labels in
common):
>>> la.add(lar1, lar2)
label_0
a
b
x
array([ 2., NaN])
which is the same result you get with lar1 + lar2:
>>> lar1 + lar2
label_0
a
b
x
array([ 2., NaN])
If one data element is missing in one larry but not in the other, then you
can replace the missing value with `missone` (here 0):
>>> la.add(lar1, lar2, missone=0)
label_0
a
b
x
array([ 2., 2.])
An outer join:
>>> la.add(lar1, lar2, join='outer')
label_0
a
b
c
dd
x
array([ 2., NaN, NaN, NaN])
An outer join with single and double missing values replaced by zero:
>>> la.add(lar1, lar2, join='outer', missone=0, misstwo=0)
label_0
a
b
c
dd
x
array([ 2., 2., 0., 0.])