Skip to content

(김*서)(강의노트 15장) Nan의 의미 관련 #64

@dimdimseo

Description

@dimdimseo
import pandas as pd

data = {'a': 1, 'b': 2, 'c': 3}
s = pd.Series(data, index=['a', 'b', 'd'])

print(s)

index에 없는 'd'를 넣으면 NaN이 생성됩니다

NaN이 생성되는 이유와 NaN이 가지는 의미가 궁금합니다.

또한 공부 중에 시리즈도 연산이 가능하다고 해서

import pandas as pd

s = pd.Series([1, 2, None, 4])

print(s.mean())

None값이 있음에도 평균값이 구해지는 것을 알 수 있었습니다

그렇다면 여기에서는 None은 없는 취급을 받는 것인지 궁금합니다.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions