Skip to content

Commit

Permalink
No public description
Browse files Browse the repository at this point in the history
PiperOrigin-RevId: 572603370
  • Loading branch information
drewbryant authored and colaboratory-team committed Oct 11, 2023
1 parent 9b78273 commit f27986f
Showing 1 changed file with 25 additions and 22 deletions.
47 changes: 25 additions & 22 deletions google/colab/_quickchart.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,15 +63,11 @@ def _ensure_dataframe_registry():
chart_sections = []

if numeric_cols:
selected_numeric_cols = numeric_cols[:max_chart_instances]
chart_sections += [
_quickchart_helpers.value_plots_section(
df, selected_numeric_cols, _DATAFRAME_REGISTRY
),
chart_sections.append(
_quickchart_helpers.histograms_section(
df, selected_numeric_cols, _DATAFRAME_REGISTRY
),
]
df, numeric_cols[:max_chart_instances], _DATAFRAME_REGISTRY
)
)

if categorical_cols:
selected_categorical_cols = categorical_cols[:max_chart_instances]
Expand All @@ -90,6 +86,27 @@ def _ensure_dataframe_registry():
),
]

if time_cols:
chart_sections.append(
_quickchart_helpers.time_series_line_plots_section(
df,
_select_time_series_cols(
time_cols=time_cols,
numeric_cols=numeric_cols,
categorical_cols=categorical_cols,
k=max_chart_instances,
),
_DATAFRAME_REGISTRY,
),
)

if numeric_cols:
chart_sections.append(
_quickchart_helpers.value_plots_section(
df, numeric_cols[:max_chart_instances], _DATAFRAME_REGISTRY
)
)

if len(categorical_cols) >= 2:
chart_sections += [
_quickchart_helpers.heatmaps_section(
Expand All @@ -110,20 +127,6 @@ def _ensure_dataframe_registry():
),
]

if time_cols:
chart_sections.append(
_quickchart_helpers.time_series_line_plots_section(
df,
_select_time_series_cols(
time_cols=time_cols,
numeric_cols=numeric_cols,
categorical_cols=categorical_cols,
k=max_chart_instances,
),
_DATAFRAME_REGISTRY,
),
)

if not chart_sections:
print('No charts were generated by quickchart')
return chart_sections
Expand Down

0 comments on commit f27986f

Please sign in to comment.