일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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 |
- GIT
- hive
- math
- PySpark
- Github
- PANDAS
- numpy
- 파이썬
- c#
- SQL
- django
- Google Spreadsheet
- matplotlib
- dataframe
- Excel
- string
- Mac
- Apache
- PostgreSQL
- Python
- Java
- Redshift
- Google Excel
- array
- google apps script
- gas
- Kotlin
- Tkinter
- list
- Today
- Total
목록문자열 찾기 (2)
달나라 노트
Python 함수 중 find는 어떤 문자에서 특정 문자열의 위치를 찾아줍니다. 사용법은 아래와 같습니다. string.find(text, start_index, end_index) string = 내가 find를 적용할 문자입니다. text = string 속에서 위치를 찾을 문자열입니다. start_index = string의 몇 번째 글자부터 찾을지를 나타냅니다. 첫 번째 글자는 0이며 1씩 증가합니다. 생략할 수 있으며 생략할 경우 0이 됩니다. end_index = string의 몇 번째 글짜까지 찾을지를 나타냅니다. 생략할 수 있으며 생략할 경우 문자 끝까지를 의미합니다. find의 결과로 매칭되는 문자열의 위치를 찾을 수 없는 경우 -1이 return됩니다. test_string = 'wat..
position(text1 in text2) Redshift의 position 함수는 위처럼 사용할 수 있으며 text1을 text2에서 찾아 그 위치를 반환합니다. selectposition('a' in 'abcde') ; - Result 1 selectposition('b' in 'abcde') ; - Result 2 selectposition('c' in 'abcde') ; - Result 3 selectposition('d' in 'abcde') ; - Result 4 selectposition('e' in 'abcde') ; - Result 5 위 예시를 보면 이해가 쉽습니다. a, b, c, d, e라는 각각의 문자를 'abcde'라는 문자열에서 찾아 그 위치를 반환해줍니다. 가장 첫번째 위치..