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

Fix plot for multi-index columns. #830

Merged
merged 1 commit into from
Sep 26, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 9 additions & 9 deletions databricks/koalas/plot.py
Original file line number Diff line number Diff line change
Expand Up @@ -415,16 +415,16 @@ def _make_plot(self):
colors = self._get_colors(num_colors=1)
stacking_id = self._get_stacking_id()

sdf = self.data.to_spark()
sdf = self.data._sdf

for i, data_column in enumerate(self.data._internal.data_columns):
for i, idx in enumerate(self.data._internal.column_index):
# 'y' is a Spark DataFrame that selects one column.
y = sdf.select(data_column)
y = sdf.select(self.data._internal.scol_for(idx))
ax = self._get_ax(i)

kwds = self.kwds.copy()

label = pprint_thing(data_column)
label = pprint_thing(idx if len(idx) > 1 else idx[0])
kwds['label'] = label

style, kwds = self._apply_style_colors(colors, kwds, i, label)
Expand Down Expand Up @@ -579,17 +579,17 @@ def _make_plot(self):
colors = self._get_colors(num_colors=1)
stacking_id = self._get_stacking_id()

sdf = self.data.to_spark()
sdf = self.data._sdf

for i, data_column in enumerate(self.data._internal.data_columns):
for i, idx in enumerate(self.data._internal.column_index):
# 'y' is a Spark DataFrame that selects one column.
y = sdf.select(data_column)
y = sdf.select(self.data._internal.scol_for(idx))
ax = self._get_ax(i)

kwds = self.kwds.copy()

label = pprint_thing(data_column)
kwds['label'] = data_column
label = pprint_thing(idx if len(idx) > 1 else idx[0])
kwds['label'] = label

style, kwds = self._apply_style_colors(colors, kwds, i, label)
if style is not None:
Expand Down
Loading