pandas.where function

see

https://pandas.pydata.org/pandas-docs/stable/reference/api/pandas.DataFrame.where.html

The source:

https://github.com/pandas-dev/pandas/blob/v1.2.4/pandas/core/generic.py#L9147-L9288

这个函数的声明是:

DataFrame.where(condother=naninplace=Falseaxis=Nonelevel=Noneerrors='raise'try_cast=False)

这里的other对应cond为False的情况。

inplace为True会直接在DataFrame对象上操作,返回None:

Returns
-------
Same type as caller or None if ``inplace=True``.

posted @ 2021-04-14 20:32  LeoGIS  阅读(67)  评论(0编辑  收藏  举报