2020. 8. 26. 23:19ㆍ분석 Python/구현 및 자료
전처리 앞으로 해야 할 것이 더 많지만, 일단 찾은 것까지만 기록해보고자 한다.
import re
string = '@@He11o Wor1d!'
string = re.sub(r'([a-zA-Z])[@31!]+(?=[a-zA-Z])', r'\1', string)
string
string = 'n"t'
re.sub(r'([a-zA-Z])"(?=[a-zA-Z])',r"\1'",string)
string = '4"t'
re.sub(r'([a-zA-Z1-9])"(?=[a-zA-Z])',r"\1'",string)
string = 'n" '
re.sub(r'([a-zA-Z])" ',r"\1",string)
'n'
string = ' "nL'
re.sub(r'\s"([a-zA-Z]{2,})', r" \1",string)
' nL'
string = '""ADASDASD""'
re.sub(r'""', r'"',string)
'"ADASDASD"'
https://stackoverflow.com/questions/47038551/removing-symbols-between-letters-python
Removing symbols between letters Python
I would like to remove certain symbols from a string. I only want to remove symbols that are between letters. If my question wasn't clear enough then here are some examples: symbols are @31! Input...
stackoverflow.com
https://stackoverflow.com/questions/10660435/pythonic-way-to-create-a-long-multi-line-string?rq=1
Pythonic way to create a long multi-line string
I have a very long query. I would like to split it in several lines in Python. A way to do it in JavaScript would be using several sentences and joining them with a + operator (I know, maybe it's n...
stackoverflow.com
'분석 Python > 구현 및 자료' 카테고리의 다른 글
[Python] 특정 command psutil로 사용하여 pid 종료하기 (0) | 2020.09.14 |
---|---|
[Python] dictionary filter (0) | 2020.09.12 |
[Python] ConfigSpace 여러 기능 사용해보기 (0) | 2020.08.20 |
[Python] 딥러닝 학습하는 도중에 GPU 사용량 확인하기 (1) | 2020.08.19 |
[Python] H2O로 Randomforest 해보기 (0) | 2020.08.10 |