Commit 95ebe3b3 authored by Georgii.Zorabov's avatar Georgii.Zorabov Committed by intellij-monorepo-bot
Browse files

DS-5920 fixed incorrect dash in histogram tooltips for Windows case


Merge-request: IJ-MR-118912
Merged-by: default avatarGeorgii Zorabov <georgii.zorabov@jetbrains.com>
(cherry picked from commit 5e07344b21850196e10570e4ab114ea957e364e2)

IJ-MR-118912

GitOrigin-RevId: 3530061eedad61c9b425478ce29890120416892d
parent 806d1993
Branches unavailable Tags unavailable
No related merge requests found
Showing with 5 additions and 2 deletions
+5 -2
......@@ -194,7 +194,8 @@ def analyze_numeric_column(column):
else:
format_function = lambda x: round(x, 1)
bin_labels = ['{} — {}'.format(format_function(bin_edges[i]), format_function(bin_edges[i+1])) for i in range(ColumnVisualisationUtils.NUM_BINS)]
# so {} — {} will be correctly viewed both on Mac and Windows
bin_labels = ['{} \u2014 {}'.format(format_function(bin_edges[i]), format_function(bin_edges[i+1])) for i in range(ColumnVisualisationUtils.NUM_BINS)]
bin_count_dict = {label: count for label, count in zip(bin_labels, counts)}
res = bin_count_dict
return add_custom_key_value_separator(res.items())
......
......@@ -159,7 +159,9 @@ def analyze_numeric_column(column, col_name):
if unique_values > ColumnVisualisationUtils.NUM_BINS:
counts, bin_edges = np.histogram(column, bins=ColumnVisualisationUtils.NUM_BINS)
format_function = int if column.is_integer() else lambda x: round(x, 1)
bin_labels = ['{} — {}'.format(format_function(bin_edges[i]), format_function(bin_edges[i + 1])) for i in range(ColumnVisualisationUtils.NUM_BINS)]
# so {} — {} will be correctly viewed both on Mac and Windows
bin_labels = ['{} \u2014 {}'.format(format_function(bin_edges[i]), format_function(bin_edges[i + 1])) for i in range(ColumnVisualisationUtils.NUM_BINS)]
res = add_custom_key_value_separator(zip(bin_labels, counts))
else:
counts = column.value_counts().sort(by=col_name).to_dict()
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment