python_package/pandas

pandas.notna() / notnull()

Xenrose 2024. 10. 11. 23:36

#### 아래 내용은 pandas 2.0.3 버전으로 작성됨.
# ** notna() / notnull() 똑같은 메소드임!**

# 0. 바로 사용하기

`DataFrame.notnull()`

* DataFrame 내 요소를 조사하여 결측치일 경우 False 아닐 경우 True인 DataFrame을 반환함.
* `isna()`: 결측치면 True
* `notna()`: 결측치가 아니면 True


<br>

___

# 1. 기본형

## DataFrame
`DataFrame.notna()`


## Series
`Series.notna()`


## Index
`Index.notna()`


<br>

___
# 2. 기능

* DataFrame/Series/Index 내 요소를 조사하여 결측치가 아닐 경우 True, 맞을 경우 False인 객체 반환함.

_공백 및 numpy.inf는 결측치로 보지 않음._
단, `pandas.options.mode.use_inf_as_na = True` 설정시 numpy.inf를 결측치로 처리함


<br>

___
# 3. 파라미터

* 파라미터 없음.

<br>

___


# ref
1. https://pandas.pydata.org/docs/reference/api/pandas.DataFrame.notnull.html
2. https://pandas.pydata.org/docs/reference/api/pandas.Series.notnull.html
3. https://pandas.pydata.org/docs/reference/api/pandas.Index.notnull.html

'python_package > pandas' 카테고리의 다른 글

pandas.dropna()  (0) 2024.10.11
pandas.to_numeric()  (0) 2024.10.11
pandas.astype()  (0) 2024.10.11
pandas.isna() / isnull()  (0) 2024.10.11
pandas.cut()  (0) 2024.10.11