mirror of
https://github.com/apache/superset.git
synced 2026-04-19 08:04:53 +00:00
feat: Adds Histogram chart migration logic (#28780)
This commit is contained in:
committed by
GitHub
parent
dabb4e064f
commit
df0b1cb8ed
@@ -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:
|
||||
|
||||
Reference in New Issue
Block a user