Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
Return type
--------
Plotly
"""
self._init_cols(locals())
if user_based:
counts = self.filter_cluster(
cluster, index_col=self._index_col()
).groupby(self._event_col())[self._index_col()].nunique().loc[funnel_events]
else:
counts = self.filter_cluster(
cluster, index_col=index_col
).groupby(self._event_col())[self._event_time_col()].count().loc[funnel_events]
counts = counts.fillna(0)
return funnel.funnel_chart(counts.astype(int).tolist(),
funnel_events,
'Funnel for cluster {}'.format(cluster),
interactive=interactive)