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 |
Tags
- matplotlib
- Dictionary
- dendrogram
- del
- function
- numpy
- 최댓값
- nan
- data
- string
- DataAccess
- insert()
- analizer
- append()
- elbow method
- count()
- Python
- wcss
- pandas
- 반복문
- Machine Learning
- 덴드로그램
- DataFrame
- IN
- 최솟값
- len()
- 분류 결과표
- list
- sklearn
- hierarchical_clustering
Archives
- Today
- Total
개발공부
[Python] String count(), in, startswith() 본문

문자열의 갯수 파악
- count() - 찾는 문자열이 몇개 있는지 알려준다.
>>> poem.count('year')
2
>>> poem.count('banana')
0
in - 문자열내 해당 단어가 있는지 확인할 수 있다.
>>> 'year' in poem
True
>>> 'banana' in poem
False
startwith('a') - 문자열이 a로 시작하면 True를 반환, 아닐시 False를 반환한다.
>>> file = '2022_05_01_report_3.xlsx'
>>> file.startswith('2022')
True
'Python > Basic' 카테고리의 다른 글
| [Python] List 변경, append(), insert(), + (0) | 2022.04.20 |
|---|---|
| [Python] List 특징, 생성, 오프셋으로 값 얻기 (0) | 2022.04.20 |
| [Python] String len(), find(), rfind() (0) | 2022.04.20 |
| [Python] String 변경, replace() (0) | 2022.04.20 |
| [Python]String +연산자, upper(), lower(), title(), spit() (0) | 2022.04.20 |