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

write quantiles to value repetitions #64

Closed
wants to merge 3 commits into from

Conversation

bmramor
Copy link
Collaborator

@bmramor bmramor commented Jan 31, 2024

No description provided.

if len(frequencies) < args.histogram_max_bins:
out_dict[k]["quantiles"] = str(sorted(list(frequencies)))
else:
out_dict[k]["quantiles"] = str(quantiles(list(frequencies), n=args.histogram_max_bins))
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

list(frequencies) is redundant, when defining frequencies you can just .tolist() and reuse that

out_dict[k]["quantiles"] = str(sorted(list(frequencies)))
else:
out_dict[k]["quantiles"] = str(quantiles(list(frequencies), n=args.histogram_max_bins))
print(out_dict)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why print this? This will clog the output/logs

@@ -9,6 +9,7 @@

import numpy as np
import pandas as pd
from statistics import quantiles
Copy link
Collaborator

@SkBlaz SkBlaz Feb 12, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Note that numpy has quantile functions too, even though this requires no extra dependencies, so it's fine

@SkBlaz SkBlaz requested a review from miha-jenko February 12, 2024 20:41
@bmramor bmramor closed this Feb 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants