def create_dendrogram(X, orientation='bottom', labels=None, colorscale=None, distfun=None, linkagefun=(lambda x: sch.linkage(x, 'complete'))):
 if ((not scp) or (not scs) or (not sch)):
  raise ImportError('FigureFactory.create_dendrogram requires scipy,                             scipy.spatial and scipy.hierarchy')
 s = X.shape
 if (len(s) != 2):
  exceptions.PlotlyError('X should be 2-dimensional array.')
 if (distfun is None):
  distfun = scs.distance.pdist
 dendrogram = _Dendrogram(X, orientation, labels, colorscale, distfun=distfun, linkagefun=linkagefun)
 return {'layout': dendrogram.layout, 'data': dendrogram.data}

def create_dendrogram ( X , orientation = 'bottom' , labels = None , colorscale = None , distfun = None , linkagefun = ( lambda x : sch . linkage ( x , 'complete' ) ) ) : if ( ( not scp ) or ( not scs ) or ( not sch ) ) : raise ImportError ( 'FigureFactory.create_dendrogram requires scipy,                             scipy.spatial and scipy.hierarchy' ) s = X . shape if ( len ( s ) != 2 ) : exceptions . PlotlyError ( 'X should be 2-dimensional array.' ) if ( distfun is None ) : distfun = scs . distance . pdist dendrogram = _Dendrogram ( X , orientation , labels , colorscale , distfun = distfun , linkagefun = linkagefun ) return { 'layout' : dendrogram . layout , 'data' : dendrogram . data }
beta function that returns a dendrogram plotly figure object .