当前位置: 首页>>代码示例>>Python>>正文


Python Series.hist方法代码示例

本文整理汇总了Python中pandas.core.series.Series.hist方法的典型用法代码示例。如果您正苦于以下问题:Python Series.hist方法的具体用法?Python Series.hist怎么用?Python Series.hist使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在pandas.core.series.Series的用法示例。


在下文中一共展示了Series.hist方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: hist

# 需要导入模块: from pandas.core.series import Series [as 别名]
# 或者: from pandas.core.series.Series import hist [as 别名]
def hist(self, bins=10, **kwds):
        """
        Histogram.

        Parameters
        ----------
        bins : integer, default 10
            Number of histogram bins to be used
        `**kwds` : optional
            Additional keyword arguments are documented in
            :meth:`pandas.Series.plot`.

        Returns
        -------
        axes : :class:`matplotlib.axes.Axes` or numpy.ndarray of them
        """
        return self(kind='hist', bins=bins, **kwds) 
开发者ID:Frank-qlu,项目名称:recruit,代码行数:19,代码来源:_core.py

示例2: hist

# 需要导入模块: from pandas.core.series import Series [as 别名]
# 或者: from pandas.core.series.Series import hist [as 别名]
def hist(self, bins=10, **kwds):
        """
        Histogram

        Parameters
        ----------
        bins: integer, default 10
            Number of histogram bins to be used
        `**kwds` : optional
            Additional keyword arguments are documented in
            :meth:`pandas.Series.plot`.

        Returns
        -------
        axes : :class:`matplotlib.axes.Axes` or numpy.ndarray of them
        """
        return self(kind='hist', bins=bins, **kwds) 
开发者ID:birforce,项目名称:vnpy_crypto,代码行数:19,代码来源:_core.py

示例3: _args_adjust

# 需要导入模块: from pandas.core.series import Series [as 别名]
# 或者: from pandas.core.series.Series import hist [as 别名]
def _args_adjust(self):
        if is_integer(self.bins):
            # create common bin edge
            values = (self.data._convert(datetime=True)._get_numeric_data())
            values = np.ravel(values)
            values = values[~isna(values)]

            hist, self.bins = np.histogram(
                values, bins=self.bins,
                range=self.kwds.get('range', None),
                weights=self.kwds.get('weights', None))

        if is_list_like(self.bottom):
            self.bottom = np.array(self.bottom) 
开发者ID:Frank-qlu,项目名称:recruit,代码行数:16,代码来源:_core.py

示例4: _plot

# 需要导入模块: from pandas.core.series import Series [as 别名]
# 或者: from pandas.core.series.Series import hist [as 别名]
def _plot(cls, ax, y, style=None, bins=None, bottom=0, column_num=0,
              stacking_id=None, **kwds):
        if column_num == 0:
            cls._initialize_stacker(ax, stacking_id, len(bins) - 1)
        y = y[~isna(y)]

        base = np.zeros(len(bins) - 1)
        bottom = bottom + \
            cls._get_stacked_values(ax, stacking_id, base, kwds['label'])
        # ignore style
        n, bins, patches = ax.hist(y, bins=bins, bottom=bottom, **kwds)
        cls._update_stacker(ax, stacking_id, n)
        return patches 
开发者ID:Frank-qlu,项目名称:recruit,代码行数:15,代码来源:_core.py

示例5: grouped_hist

# 需要导入模块: from pandas.core.series import Series [as 别名]
# 或者: from pandas.core.series.Series import hist [as 别名]
def grouped_hist(data, column=None, by=None, ax=None, bins=50, figsize=None,
                 layout=None, sharex=False, sharey=False, rot=90, grid=True,
                 xlabelsize=None, xrot=None, ylabelsize=None, yrot=None,
                 **kwargs):
    """
    Grouped histogram

    Parameters
    ----------
    data : Series/DataFrame
    column : object, optional
    by : object, optional
    ax : axes, optional
    bins : int, default 50
    figsize : tuple, optional
    layout : optional
    sharex : boolean, default False
    sharey : boolean, default False
    rot : int, default 90
    grid : bool, default True
    kwargs : dict, keyword arguments passed to matplotlib.Axes.hist

    Returns
    -------
    axes : collection of Matplotlib Axes
    """
    _raise_if_no_mpl()
    _converter._WARN = False

    def plot_group(group, ax):
        ax.hist(group.dropna().values, bins=bins, **kwargs)

    xrot = xrot or rot

    fig, axes = _grouped_plot(plot_group, data, column=column,
                              by=by, sharex=sharex, sharey=sharey, ax=ax,
                              figsize=figsize, layout=layout, rot=rot)

    _set_ticks_props(axes, xlabelsize=xlabelsize, xrot=xrot,
                     ylabelsize=ylabelsize, yrot=yrot)

    fig.subplots_adjust(bottom=0.15, top=0.9, left=0.1, right=0.9,
                        hspace=0.5, wspace=0.3)
    return axes 
开发者ID:Frank-qlu,项目名称:recruit,代码行数:46,代码来源:_core.py

示例6: grouped_hist

# 需要导入模块: from pandas.core.series import Series [as 别名]
# 或者: from pandas.core.series.Series import hist [as 别名]
def grouped_hist(data, column=None, by=None, ax=None, bins=50, figsize=None,
                 layout=None, sharex=False, sharey=False, rot=90, grid=True,
                 xlabelsize=None, xrot=None, ylabelsize=None, yrot=None,
                 **kwargs):
    """
    Grouped histogram

    Parameters
    ----------
    data: Series/DataFrame
    column: object, optional
    by: object, optional
    ax: axes, optional
    bins: int, default 50
    figsize: tuple, optional
    layout: optional
    sharex: boolean, default False
    sharey: boolean, default False
    rot: int, default 90
    grid: bool, default True
    kwargs: dict, keyword arguments passed to matplotlib.Axes.hist

    Returns
    -------
    axes: collection of Matplotlib Axes
    """
    _raise_if_no_mpl()
    _converter._WARN = False

    def plot_group(group, ax):
        ax.hist(group.dropna().values, bins=bins, **kwargs)

    xrot = xrot or rot

    fig, axes = _grouped_plot(plot_group, data, column=column,
                              by=by, sharex=sharex, sharey=sharey, ax=ax,
                              figsize=figsize, layout=layout, rot=rot)

    _set_ticks_props(axes, xlabelsize=xlabelsize, xrot=xrot,
                     ylabelsize=ylabelsize, yrot=yrot)

    fig.subplots_adjust(bottom=0.15, top=0.9, left=0.1, right=0.9,
                        hspace=0.5, wspace=0.3)
    return axes 
开发者ID:birforce,项目名称:vnpy_crypto,代码行数:46,代码来源:_core.py


注:本文中的pandas.core.series.Series.hist方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。