Skip to content
This repository was archived by the owner on Feb 2, 2024. It is now read-only.
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 9 additions & 1 deletion sdc/datatypes/hpat_pandas_series_functions.py
Original file line number Diff line number Diff line change
Expand Up @@ -3543,7 +3543,15 @@ def hpat_pandas_series_cov_impl(self, other, min_periods=None):
if len(self_arr) < min_periods:
return numpy.nan

return numpy.cov(self_arr, other_arr)[0, 1]
new_self = pandas.Series(self_arr)

ma = new_self.mean()
mb = other.mean()

if numpy.isinf(mb):
return numpy.nan

return ((self_arr - ma) * (other_arr - mb)).sum() / (new_self.count() - 1.0)

return hpat_pandas_series_cov_impl

Expand Down