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
- elbow method
- nan
- list
- dendrogram
- sklearn
- 최솟값
- 최댓값
- 덴드로그램
- IN
- 반복문
- del
- hierarchical_clustering
- len()
- append()
- DataAccess
- Dictionary
- count()
- numpy
- wcss
- analizer
- matplotlib
- DataFrame
- data
- 분류 결과표
- pandas
- Python
- string
- Machine Learning
- insert()
- function
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 |