| 일 | 월 | 화 | 수 | 목 | 금 | 토 |
|---|---|---|---|---|---|---|
| 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 |
- MatrixFactorization
- TensorflowDeveloperCertificate
- MySQL
- Cast
- implicitData
- Visualization
- jsonlines
- 텐서플로자격증
- sshtunnel
- json
- LatentFactorModel
- 지도시각화
- wordembedding
- ExplicitData
- str.replace
- session-basedRecommendation
- VScodeNotResponding
- github2FA
- pandas
- Python
- Convert
- decimal error
- BloombergMarketConcepts
- DIF_SR
- iterrows
- vscode
- numpy.bool
- Colab
- jsonl
- gluonnlp
- Today
- Total
목록Programming (17)
garret
islice()와 slice() 모두 슬라이싱하는데 사용되는 함수다. islice()를 공부하다가 slice()의 차이점이 어떤건지 궁금해서 정리 slice() 정의 Return a slice object representing the set of indices specified by range(start, stop, step). The start and step arguments default to None. Slice objects have read-only data attributes start, stop, and step which merely return the argument values (or their default). They have no other explicit functionali..
알고리즘 공부하면서 알게 된 join() 함수. split() 과 비교하면서 공부하면서 좋을 거 같아 정리. split() 함수 string.split(separator, maxsplit) split() 함수는 string을 list로 분할해주는 함수. separator character를 기준으로 분할된다. separator의 디폴트 값은 공백(whitespace) maxsplit에는 분할할 개수 지정 split() 사용예시 txt = "mango$blueberry$kiwi$melon" x = txt.split('$',1) print(x) $ 기준으로 분할하고 1번만 분할하라는 뜻 1번만 분할되어 2개의 element로 쪼개진 걸 확인 할 수 있다. join() 함수 string.join(iterabl..
백준 알고리즘 문제를 풀면서 알게된 sys.stdout.write()함수. 출력함수인데 print() 비슷한 듯 다른 것 같아 차이점을 정리해보았다. sys.stdout 정의 used for the output of print() and expression statements and for the prompts of input(): sys.stdout.write()와 print의 차이 출력 형태 sys.stdout.write() 줄바꿈없이 이어서 출력 print() 줄바꿈하여 출력 sys.stdout.write 출력 예시 import sys for i in range(5): sys.stdout.write(f"{i}") ※ 주의사항 ※ sys.stdout.write는 string만 넣을 수 있다. str말..
요즘 알고리즘을 공부하면서 백준문제를 조금씩 풀어보고 있다. 솔루션을 보면 입력값을 받을 때 sys.stdin.readline을 종종 사용하길래 chatgpt에게 물어보았다. chatgpt의 sys.stdin.readlin 설명 sys.stdin.readline()은 파이썬에서 입력을 받는 함수 중 하나입니다. input() 함수와 비슷한 역할을 하지만, input() 함수보다 더 빠르게 입력을 처리할 수 있습니다. sys.stdin은 파이썬에서 기본적으로 제공되는 표준 입력 객체입니다. sys.stdin.readline() 함수는 이 표준 입력 객체에서 한 줄씩 문자열 형태로 입력을 받습니다. 따라서, 문자열을 입력받을 때 사용합니다. sys.stdin.readline() 함수는 입력된 문자열의 맨 끝..
python에서 JSON 파일 생성하는 법을 실습해보았다 실습용 DataFrame 만들기 import pandas as pd data_a= [['A',1,90,4],['B',2,88,5],['C',3,85,3.5]] df_a= pd.DataFrame(data_a, columns=['name','level','score','time']) df_a name level score time 0 A 1 90 4.0 1 B 2 88 5.0 2 C 3 85 3.5 01. 기본 JSON 생성 dictionary 형태로 만들어서 json.dumps()함수로 python 객체를 json 데이터로 변환한다 import json dict1={} for idx, row in df_a.iterrows(): name = row['..
Pandas의 iterrows함수와 items 함수에 대해 공부한 글. 간단한 데이터프레임을 먼저 만들어 주자 import pandas as pd data_a= [['A',1,90,4],['B',2,88,5],['C',3,85,3.5]] df_a= pd.DataFrame(data_a, columns=['name','level','score','time']) df_a name level score time 0 A 1 90 4.0 1 B 2 88 5.0 2 C 3 85 3.5 iterrows() pandas.DataFrame.iterrows — pandas 1.5.3 documentation next pandas.DataFrame.itertuples pandas.pydata.org 공식 홈페이지의 설명: I..
1. 티스토리 스킨 HTML 편집 블로그 관리 → 꾸미기 → 스킨 편집 → html 편집 바로 밑에 아래 코드 삽입 아래처럼 들어가게 삽입해 주고 → 적용 2. 블로그 글 쓸 때 수식 쓰는 법 수식 블럭을 넣고 싶을 때 가운데 정렬로 수식만 넣고 싶을 때는 아래와 같이 수식을 입력한다. $$ 수식 $$ 예시 $$ Y\_{ij}=\\begin{cases} 0, & if \\ x=0\\\\\\ 1, & \\ otherwise \\end{cases} $$ $$ Y_{ij}=\begin{cases} 0, & if \ i=j\\\ 1, & \ otherwise \end{cases} $$ 인라인 수식 문장안에 수식을 넣고 싶을 때는 아래와 같이 수식을 입력한다. # 방법1 \\(수식\\) # 방법2 $수식$ 예시 ..
SQL connection method : Standard TCP/IP over SSH 일 때 python에서 DB 접속하는 방법. 아래 내용은 vscode의 jupyter 파일로 작업하였다 MySQL에서 standard TCP/IP over SSH로 connection 생성 MySQL에서 connection method를 Standard TCP/IP over SSH로 설정하고 파라미터 설정 후 연결 SSH 연결은 key 파일이 필요하므로 SSH key file을 꼭 첨부하자 pymysql, sshtunnel 라이브러리 설치 ! pip install pymysql ! pip install sshtunnel python에서 필요한 라이브러리 설치하기 라이브러리 호출 import pymysql import ..