我是靠谱客的博主 传统嚓茶,最近开发中收集的这篇文章主要介绍理解common.count_not_none()||dedent||zsqrt,觉得挺不错的,现在分享给大家,希望可以做个参考。

概述

  • 源代码

    From ExponentialMovingWindow:

    _agg_see_also_doc = dedent(
        """
        See Also
        --------
        pandas.DataFrame.rolling.aggregate
        """
    )
    
    @doc(
        _shared_docs["aggregate"],
        see_also=_agg_see_also_doc,
        examples=_agg_examples_doc,
        versionadded="",
        klass="Series/Dataframe",
        axis="",
    )
    def std():
        return zsqrt(...)
    
    
  • common

    pandas/core/common.py

    def count_not_none(*args) -> int:
    	"""
    	Returns the count of arguments that are not None
    	"""
    	return sum(x is not None for x in args)
    

    From official API reference, cann’t find an explaination about the module of common.py. I think it is commonly used by the core develop, but it is really usefull.

    Just like the header explaination :

    """
    Misc tools for implementing data structures
    Note : pandas.core.common is 'not' part of the public API
    """
    

    pandas/core/window/common.py

    It is common utility functions for rolling oprations.

    def zsqrt(x):
        with np.errstate(all="ignore"):
            result = np.sqrt(x)
            mask = x < 0
        if isinstance(x, ABCDataFrame):
            if mask._values.any():
                result[mask] = 0
        else:
            if mask.any():
                result[mask] = 0
        return result
    
  • From textwrap import dedent

    textwrap.py module provides some convenience functions, as well as TextWrapper, the class that does all the work.

    textwrap.dedent(text)

    Remove any common leanding whitespace from every line in text.

    This can be used to make triple-quoted string line up with the left edge of the display, while still presenting them in the source code in indented form

  • from pandas.util._decorators import Appender, Substitution,

最后

以上就是传统嚓茶为你收集整理的理解common.count_not_none()||dedent||zsqrt的全部内容,希望文章能够帮你解决理解common.count_not_none()||dedent||zsqrt所遇到的程序开发问题。

如果觉得靠谱客网站的内容还不错,欢迎将靠谱客网站推荐给程序员好友。

本图文内容来源于网友提供,作为学习参考使用,或来自网络收集整理,版权属于原作者所有。
点赞(39)

评论列表共有 0 条评论

立即
投稿
返回
顶部