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
- wcss
- string
- sklearn
- analizer
- DataFrame
- 덴드로그램
- dendrogram
- hierarchical_clustering
- append()
- 최솟값
- function
- data
- del
- count()
- 분류 결과표
- matplotlib
- pandas
- IN
- nan
- len()
- Python
- insert()
- 반복문
- elbow method
- Dictionary
- Machine Learning
- list
- numpy
- 최댓값
- DataAccess
Archives
- Today
- Total
개발공부
[Python]String +연산자, upper(), lower(), title(), spit() 본문
+연산자
- 숫자 뿐만 아니라 문자열에서도 사용이 가능하다.
- 여러 문자열들을 결합할 수 있다.
>>> first_name = 'Mitch'
>>> last_name = 'Steve'
>>> first_name + last_name
'MitchSteve'
upper()
- 문자열을 대문자로 변경한다.
>>> full_name = 'Mitch Steve'
>>> full_name.upper()
'MITCH STEVE'
lower()
- 문자열을 소문자로 변경한다.
>>> full_name = 'Mitch Steve'
>>> full_name.lower()
'mitch steve'
title()
- 문자열 안의 단어들의 첫 문자를 대문자로 변경한다.
>>> full_name = 'mitch steve'
>>> full_name.title()
'Mitch Steve'
split()
- 문자열을 원하는 기준으로, 각각 분리한다. (분리되어 만들어진 것은 리스트 형태)
>>> full_name = 'Mitch Steve'
>>> full_name.split()
['Mitch', 'Steve']
>>> full_name.split('t')
['Mi', 'ch S', 'eve']'Python > Basic' 카테고리의 다른 글
| [Python] String len(), find(), rfind() (0) | 2022.04.20 |
|---|---|
| [Python] String 변경, replace() (0) | 2022.04.20 |
| [Python] String 특징, 생성, Slicing(슬라이싱) (0) | 2022.04.20 |
| [Python]Boolean (0) | 2022.04.20 |
| [Python] print(), input(), 형변환 (0) | 2022.04.18 |