Deprecated method to convert a MultiDimensionalMapping to
        a pandas DataFrame. Conversion to a dataframe now only
        supported by specific subclasses such as UniformNdMapping
        types.
977683
def dframe(self):
        
        self.param.warning("The MultiDimensionalMapping.dframe method is "
                           "deprecated and should no longer be used. "
                           "Use a more specific subclass which does support "
                           "the dframe method instead, e.g. a HoloMap.")
        try:
            import pandas
        except ImportError:
            raise Exception("Cannot build a DataFrame without the pandas library.")
        labels = self.dimensions('key', True) + [self.group]
        return pandas.DataFrame(
            [dict(zip(labels, k + (v,))) for (k, v) in self.data.items()])
239277
def dflin2dfbinarymap(dflin,col1,col2,params_df2submap={'aggfunc':'sum','binary':True,'binaryby':'nan'},test=False):
    
    # get the submap ready
    df_map=df2submap(df=dflin,
              col=col1,idx=col2,**params_df2submap)
    if test:           
        logging.debug(df_map.unstack().unique())
    # make columns and index symmetric
    df_map_symm=dfmap2symmcolidx(df_map)
    df_map_symm=df_map_symm.fillna(False)
    if test:           
        logging.debug(df_map_symm.unstack().unique())
    df_map_symm=(df_map_symm+df_map_symm.T)/2
    if test:           
        logging.debug(df_map_symm.unstack().unique())
    df_map_symm=df_map_symm!=0
    if test:           
        logging.debug(df_map_symm.unstack().unique())
    return df_map_symm
426787
def dataframe(df, **kwargs):
    
    table(df.values, list(df.columns), **kwargs)
566782
def as_frame(self):
        
        data = {sid: pd.Series(data) for sid, data in self.response_map.iteritems()}
        return pd.DataFrame.from_dict(data, orient='index')
688925
def _get_processed_dataframe(self, dataframe):
        
        dataframe.index = pd.to_datetime(dataframe['epoch'], unit='s', utc=True)
        del dataframe['epoch']
        summary = dataframe.describe(percentiles=[.80, .90, .95]).transpose().loc['scriptrun_time']
        df_grp = dataframe.groupby(pd.TimeGrouper('{}S'.format(self.interval)))
        df_final = df_grp.apply(lambda x: x.describe(percentiles=[.80, .90, .95])['scriptrun_time'])

        return {
            "raw": dataframe.round(2),
            "compiled": df_final.round(2),
            "summary": summary.round(2)
        }
1290915
def var_to_df(self):
        
        ret = {}
        self._check_pd()

        if self._flags['address'] is False:
            return pd.DataFrame.from_dict(ret)

        ret.update({'name': self.name})
        ret.update({'idx': self.idx})

        for x in self._states:
            idx = self.__dict__[x]
            ret.update({x: self.system.dae.x[idx]})
        for y in self._algebs:
            idx = self.__dict__[y]
            ret.update({y: self.system.dae.y[idx]})

        var_df = pd.DataFrame.from_dict(ret).set_index('idx')

        return var_df
68722
def as_frame(self):
        
        data = {sid: pd.Series(data) for sid, data in self.response_map.iteritems()}
        frame = pd.DataFrame.from_dict(data, orient='index')
        # layer in any missing fields just in case
        frame = frame.reindex_axis(self.request.fields, axis=1)
        return frame
374692
def mapping(self, kdims=None, vdims=None, **kwargs):
        ""
        if config.future_deprecations:
            self.param.warning(
                "The mapping method is deprecated and should no "
                "longer be used. Use another one of the common "
                "formats instead, e.g. .dframe, .array or .columns.")

        length = len(self)
        if not kdims: kdims = self.kdims
        if kdims:
            keys = zip(*[self.dimension_values(dim.name)
                         for dim in self.kdims])
        else:
            keys = [()]*length

        if not vdims: vdims = self.vdims
        if vdims:
            values = zip(*[self.dimension_values(dim.name)
                           for dim in vdims])
        else:
            values = [()]*length
        return OrderedDict(zip(keys, values))
572938
def make_dataframe(result):
    
    import pandas as pd
    ret = {}
    if isinstance(result,dict):
        if 'timeseries' in result:
            result = result['timeseries']
    for uuid, data in result.items():
        df = pd.DataFrame(data)
        if len(df.columns) == 5: # statistical data
            df.columns = ['time','min','mean','max','count']
        else:
            df.columns = ['time','value']
        df['time'] = pd.to_datetime(df['time'],unit='ns')
        df = df.set_index(df.pop('time'))
        ret[uuid] = df
    return ret
1316826
def _vertex_list_to_dataframe(ls, id_column_name):
    
    assert HAS_PANDAS, 'Cannot use dataframe because Pandas is not available or version is too low.'
    cols = reduce(set.union, (set(v.attr.keys()) for v in ls))
    df = pd.DataFrame({id_column_name: [v.vid for v in ls]})
    for c in cols:
        df[c] = [v.attr.get(c) for v in ls]
    return df
1255693
def dataframe(self):
        """"""

        if self._dataframe is None:
            try:
                import pandas as pd
            except ImportError:
                raise RuntimeError('To enable dataframe support, '
                                   'run \'pip install datadotworld[pandas]\'')

            self._dataframe = pd.DataFrame.from_records(self._iter_rows(),
                                                        coerce_float=True)

        return self._dataframe
699210
def to_pandas(self, wrap=False, **kwargs):
        

        try:
            import pandas as pd
        except ImportError:
            raise DependencyNotInstalledError(
                    'to_pandas requires for `pandas` library')

        def wrapper(result):
            df = result.values
            if wrap:
                from .. import DataFrame
                df = DataFrame(df)
            return df[self.name]

        return self.execute(wrapper=wrapper, **kwargs)
741699
def to_dense(self):
        
        data = {k: v.to_dense() for k, v in self.items()}
        return DataFrame(data, index=self.index, columns=self.columns)
1028540
def to_dataframe(self) -> "pandas.DataFrame":
        
        import pandas as pd
        df = pd.DataFrame(
            {
                "left": self.bin_left_edges,
                "right": self.bin_right_edges,
                "frequency": self.frequencies,
                "error": self.errors,
            },
            columns=["left", "right", "frequency", "error"])
        return df
515923
def fromPandas(cls, df):
        
        assert pd is not None
        if isinstance(df, pd.Series):
            df = pd.DataFrame(df)
        else:
            assert isinstance(df, pd.DataFrame)
        keys = [
            key if isinstance(key, tuple) else (key,)
            for key in df.index.tolist()
        ]
        index = [
            ('index{}'.format(i), cindex)
            for i, cindex in enumerate(zip(*keys))
        ]
        columns = [
            (str(cname), df[cname].tolist())
            for cname in df.columns.tolist()
        ]
        return cls(index=index, columns=columns)
529560
def result_dataframe(count, x, width, xmin=None, xmax=None):
    
    if xmin is None:
        xmin = x-width/2

    if xmax is None:
        xmax = x+width/2

    # Eliminate any numerical roundoff discrepancies
    # between the edges
    xmin[1:] = xmax[:-1]
    density = (count/width) / np.sum(np.abs(count))

    out = pd.DataFrame({
        'count': count,
        'x': x,
        'xmin': xmin,
        'xmax': xmax,
        'width': width,
        'density': density,
        'ncount': count/np.max(np.abs(count)),
        'ndensity': count/np.max(np.abs(density))})
    return out
1008970
def df(self, qname_predicates:bool=False, keep_variable_type:bool=True) -> pd.DataFrame:
        '''  '''
        local_df = self.df.copy()
        if qname_predicates:
            for col in self.columns:
                local_df.rename({col: self.g.qname(col)})
        if not keep_variable_type:
            pass
            # convert all to strings, watch out for lists
        return local_df