Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Null values not behaving as expected in _get_intervals method #360

Open
fealho opened this issue Jan 26, 2022 · 0 comments
Open

Null values not behaving as expected in _get_intervals method #360

fealho opened this issue Jan 26, 2022 · 0 comments
Labels
internal The issue doesn't change the API or functionality

Comments

@fealho
Copy link
Member

fealho commented Jan 26, 2022

Below is the code of the _get_intervals method:

data = data.fillna(np.nan)
frequencies = data.value_counts(dropna=False)
start = 0
end = 0
elements = len(data)
intervals = {}
means = []
starts = []
for value, frequency in frequencies.items():
prob = frequency / elements
end = start + prob
mean = start + prob / 2
std = prob / 6
if pd.isna(value):
value = np.nan

Since we start by converting all null data to np.nan in line 92, we would expect lines 107-108 to be unnecessary. If we remove them, however, we run into multiple errors, which can be found in this branch, where the change above was implemented.

We should figure out why this error is happening, to make sure the code works as intended.

@fealho fealho added the internal The issue doesn't change the API or functionality label Jan 26, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
internal The issue doesn't change the API or functionality
Projects
None yet
Development

No branches or pull requests

1 participant