You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@superset.apache.org by GitBox <gi...@apache.org> on 2019/04/19 05:45:08 UTC
[GitHub] [incubator-superset] mistercrunch commented on a change in pull
request #7325: [Viz] transpose pivot table
mistercrunch commented on a change in pull request #7325: [Viz] transpose pivot table
URL: https://github.com/apache/incubator-superset/pull/7325#discussion_r276906010
##########
File path: superset/viz.py
##########
@@ -681,9 +687,13 @@ def get_data(self, df):
if aggfunc == 'sum':
aggfunc = lambda x: x.sum(min_count=1) # noqa: E731
+ groupby = self.form_data.get('groupby')
+ columns = self.form_data.get('columns')
+ if self.form_data.get('transpose_pivot'):
+ groupby, columns = columns, groupby
df = df.pivot_table(
- index=self.form_data.get('groupby'),
- columns=self.form_data.get('columns'),
+ index=groupby,
Review comment:
Would using `df = df.T` instead work?
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
With regards,
Apache Git Services
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org