feat: Adds Histogram chart migration logic (#28780)

This commit is contained in:
Michael S. Molina
2024-06-05 13:33:50 -03:00
committed by GitHub
parent dabb4e064f
commit df0b1cb8ed
11 changed files with 118 additions and 6 deletions

View File

@@ -53,7 +53,7 @@ def histogram(
raise ValueError(f"The column '{column}' must be numeric.")
# calculate the histogram bin edges
bin_edges = np.histogram_bin_edges(df[column], bins=bins)
bin_edges = np.histogram_bin_edges(df[column].dropna(), bins=bins)
# convert the bin edges to strings
bin_edges_str = [
@@ -62,7 +62,7 @@ def histogram(
]
def hist_values(series: Series) -> np.ndarray:
result = np.histogram(series, bins=bin_edges)[0]
result = np.histogram(series.dropna(), bins=bin_edges)[0]
return result if not cumulative else np.cumsum(result)
if len(groupby) == 0: