왕현성
코딩발자취
왕현성
전체 방문자
오늘
어제
  • 코딩 (277)
    • Python (71)
    • Java (16)
    • MySQL (34)
    • 인공지능 (48)
      • 머신러닝 (16)
      • 딥러닝 (32)
    • 영상처리 (4)
    • Rest API (21)
    • Android Studio (25)
    • streamlit (13)
    • DevOps (22)
      • AWS (9)
      • PuTTY (5)
      • Git (4)
      • Serverless (2)
      • Docker (2)
    • IT 기술 용어 (6)
    • 디버깅 ( 오류 해결 과정 ) (17)

블로그 메뉴

  • 홈
  • 태그
  • 방명록

공지사항

인기 글

태그

  • OpenCV
  • ckpt_file
  • maskimage
  • 의료이미징
  • pytorch
  • unsupervised
  • numpy
  • get_long_description
  • ComputerVision
  • matplotlib
  • encoding='utf-8'
  • 기상탐사
  • PYTHON
  • labelme
  • TensorFlow
  • 영상처리역사
  • alibi-detection
  • 컴퓨터비전
  • pip install labelme
  • alibidetect
  • 딥러닝
  • imageprocessing
  • 영상처리
  • 비지도학습
  • yolov8
  • 영상기술
  • labelme UnocodeDecodeError
  • PIL
  • UnboundLocalError
  • tune()

최근 댓글

최근 글

티스토리

250x250
hELLO · Designed By 정상우.
왕현성

코딩발자취

파이썬Python pandas DataFrame 포함되지않는 문자 찾기 '~', contains()
Python

파이썬Python pandas DataFrame 포함되지않는 문자 찾기 '~', contains()

2022. 11. 29. 12:12
728x90

DataFrame은 다음과 같다

 

 

요구사항 :  df의 데이터 중 choice_description 값에 Vegetables 들어가지 않는 경우의 갯수를 출력하라

 

df['choice_description'].str.contains('Vegetables',case=False) ## 먼저 포함되는 것을 찾는다.

(df['choice_description'].str.contains('Vegetables',case=False) == False).sum() ## ~을 알기 전에 내가 사용했던 코드, 

~df['choice_description'].str.contains('Vegetables',case=False) ## 이것보다 간단한 방법이 있는 것을 알게된 후 ~을 사용한 코드

 

~을 사용하니 True와 False가 서로 바뀐 결과는 위 사진과 같습니다.

'Python' 카테고리의 다른 글

Python파이썬 pandas 데이터 시각화 plot()  (0) 2022.11.29
Python파이썬 pandas 데이터프레임으로 만들기 to_frame()  (0) 2022.11.29
Python파이썬 데이터 시각화 matplotlib heatmaps hist2d()  (0) 2022.11.28
Python파이썬 데이터 시각화 matplotlib seaborn regplot , pairplot  (0) 2022.11.28
Python파이썬 데이터 시각화 matplotlib scatterplots,  (0) 2022.11.28
    'Python' 카테고리의 다른 글
    • Python파이썬 pandas 데이터 시각화 plot()
    • Python파이썬 pandas 데이터프레임으로 만들기 to_frame()
    • Python파이썬 데이터 시각화 matplotlib heatmaps hist2d()
    • Python파이썬 데이터 시각화 matplotlib seaborn regplot , pairplot
    왕현성
    왕현성
    AI 머신비전 학습일지

    티스토리툴바