Python

[module] Python - math.isnan() 메서드 ★ - NaN 여부 체크. (= isnan메서드 = 이즈난메서드)

4205
목차
  1. math.isnan() 예제 - NaN 여부 체크
  2. math.isnan() 정의 
  3. math.isnan() 구문

 

math.isnan() 예제 - NaN 여부 체크

 

import math

 

print (math.isnan (12)) # False

print (math.isnan (-12.34)) # False

print (math.isnan (+12.34)) # False

print (math.isnan (math.inf))# False

print (math.isnan (float("nan"))) # True

print (math.isnan (float("inf"))) # False

print (math.isnan (float("-inf"))) # False

print (math.isnan (math.nan)) # True

 

 

math.isnan() 정의

 

NaN (숫자 아님 : Not a Number) 여부 체크.

 


 

※ NaN 맞으면 True 반환, 아니면 False 반환.

※ Python 3.5

 

 

math.isnan() 구문

 

math.isnan(x)

 


[매개변수]

 

x

필수. NaN인지 체크할 값.

 


[반환값]

 

  • NaN 맞으면 : True 반환.
  • NaN 아니면 : False 반환.

 



분류 제목
howto Python - 리스트 중복요소 제거. ★ (Remove List Duplicate)
howto Python - 문자열 순서 뒤집기= 역순 ★ (Reverse a String)
howto Python - 사용자 입력값 더하기 ★ (Add Two Numbers)
shell Python Shell (파이썬 셸 : IDLE) 글자 크기 확대
shell Python 화면 청소 (= 파이썬 화면 지우기)
shell Python Shell (파이썬 셸 : IDLE) 라인 번호 표시
shell Python Shell (파이썬 셸 : IDLE) 입력했던 코드 불러오기. (= 재입력, 다시입력) + 파일…
shell Python Shell (파이썬 셸 : IDLE) 창크기 (= 창너비 x 창높이) 설정.
numpy PY - NumPy Intro (넘파이 소개)
numpy PY - NumPy Start (설치/시작/버전확인) ★ - 모듈 불러오기 (3가지 방법)
numpy PY - NumPy Creating Arrays (배열 생성) ★ - 배열 차원 (= 중첩배열 = 다차원배열…
numpy PY - NumPy Array Indexing (배열 색인) ★ - 배열 요소에 접근
numpy PY - NumPy Array Slicing (배열 자르기) ★ - 배열 요소 일부만 선택.
numpy PY - NumPy Data Types (데이터타입) ★ - 종류 / 확인 / 변환.
numpy PY - NumPy Array Copy vs View (배열 복사 vs 뷰) ★
21/32
목록
 홈  PC버전 로그인 일본어
그누앞단언어
그누뒷단언어
그외코딩언어
그누보드
제작의뢰
Q&A
커뮤니티
웹유틸
회원센터
홈짱닷컴 PC버전 로그인