Notice
Recent Posts
Recent Comments
Link
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | 2 | 3 | ||||
4 | 5 | 6 | 7 | 8 | 9 | 10 |
11 | 12 | 13 | 14 | 15 | 16 | 17 |
18 | 19 | 20 | 21 | 22 | 23 | 24 |
25 | 26 | 27 | 28 | 29 | 30 | 31 |
Tags
- 버스분석
- 배열추가
- 탈출문자
- barplot
- DataFrame
- 백준 11718
- plot in r
- 10172
- 값추가
- 광명시버스분석
- await
- 배열삭제
- 데이터분석
- setstate
- 값삭제
- R데이터형태
- useState
- 그래픽
- 백준
- asynchronization
- vetor
- 이용현황분석
- 백준 10172
- react #회원가입 #비밀번호비교
- barplot in r
- 이스케이프시퀀스
- 그대로 출력하기
- getline
- R 그래프
- React
Archives
- Today
- Total
devlog_zz
[python] Counter list 원소 개수 세기 본문
728x90
from collections import Counter
print(Counter(['a','b','c','a','d','c']))
print(Counter(['a','b','c','a','d','c'])['a'])
Counter 접근
Counter[찾고자하는 값]
Counter({'a': 2, 'c': 2, 'b': 1, 'd': 1})
2
728x90
'Back End > python' 카테고리의 다른 글
[python] list 최대값, 최소값 index (0) | 2022.08.07 |
---|---|
[python] 몫, 나머지 구하기 (0) | 2022.08.07 |
[python] set - list 중복 제거 (0) | 2022.08.07 |
[python] enumerate 함수 (0) | 2022.08.07 |
[python] list 길이 (0) | 2022.08.07 |
Comments