Closed Nick-Hemenway closed 1 month ago
yea that would be very nice to have working
for now you can use df['cos_col'] = df.angle_col.apply(lambda x:np.cos(x))
this works now, when I run it I get
(<Quantity([1 2 3], 'degree')>,)
(<Quantity([ 4 9 16], 'inch ** 2')>,)
angle_col pint[degree]
area_col pint[inch ** 2]
cos_col pint[]
length_col pint[inch]
dtype: object
Currently to use a lot of numpy functionality, a user must first cast their series to a standard pint Quantity array. It would be great if operating on unit aware pandas series with numpy could be as seamless as working with regular pint (not pint-pandas) and numpy.
Example:
The currently required behavior is very verbose and requires a ton of extra typing and mental overhead when working with large datasets that have a ton of columns.
I think this functionality might be related to Issue #65