KxSystems / pykx

PyKX is a Python first interface to the worlds fastest time-series database kdb+ and it's underlying vector programming language q.
https://code.kx.com/pykx
Other
45 stars 10 forks source link

Added implementation and tests for std() function #11

Closed nipsn closed 8 months ago

nipsn commented 8 months ago

An implementation of the std function: https://pandas.pydata.org/docs/reference/api/pandas.DataFrame.std.html

When the ddof parameter is equal to the table length (after preprocessing the axis), we essentially divide by zero when we compute the standard deviation. In pure q, this results in infinite values (0W), but in pandas, this operation results in nan values, so I kept this later case on my implementation to match pandas' imlementation.

Also, pandas' implementation includes an extra parameter, skipna. However, since it's ignored on mean and median, it has been ignored here as well