Never give up
블로그 이미지

Home

Write

Setting

About Me

  • 분류 전체보기 (58)
    • Computer vision (1)
      • Detection (1)
      • Segmentation (1)
      • Depth estimation (1)
      • Technique (0)
    • Programming (40)
      • Pytorch (2)
      • Python (2)
      • Linux (1)
      • (Dev|ML)OPS (0)
      • C++ (5)
      • 님들은 삽질하지 마세요 (18)
      • 코딩테스트 (2)
      • Why (1)
      • AI development (8)
      • DB (0)
    • 기본기 (3)
      • 딥러닝 관련 수학 (0)
      • 프로그래밍 (2)
    • 잡설 (6)
    • Data Insight (5)
no image
3 in pd.Series(3) 이게 왜 False일까?
연산되는 방식 python의 모든 연산자는 특수메서드로 구현되어있다. 따라서 p in z라는 구문을 실행했을 때 __contains__라는 특수메서드가 호출되게 된다. pandas 구현 아래의 특수메서드가 호출된다 이때 key in self._info_axis연산을 하게 되는데 # pandas.core.generic.py > NDFrame > __contains__ @final def __contains__(self, key) -> bool_t: """True if the key is in the info axis""" return key in self._info_axis 따라서 아래와 같은 방식으로 Index의 값과 비교해야지 True를 반환한다. * 추가적으로 @final 데코레이터는 상속 및 재정의..
2023.03.25
Programming/Why
Prev 1 Next
uTube· Designed By ushin20

티스토리툴바