visualizer.py 文件源码

python
阅读 27 收藏 0 点赞 0 评论 0

项目:coquery 作者: gkunter 项目源码 文件源码
def map_data(self, func):
        """
        Map the dataframe using :func:`func`.

        This method wraps the function :func:`func` so that a facet is
        plotted for the grouping variables. In order for this to work,
        :func:`func` has to take two values: `data`, which is a sub-
        dataframe after grouping, and `color`, which is currently not
        used, but which must be handled by `func` anyway.

        Technically, it calls :func:`FacetGrid.map_dataframe` from
        `seaborn` with `func` as a parameter if more than one plot
        is required. Otherwise, it calls `func` directly, as `FacetGrid`
        can have problems if only one plot is drawn.

        Parameters
        ----------
        func : function
            The plotting function.
        """
        if self._col_factor:
            self.g.map_dataframe(func)
        else:
            func(self._table, None)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号