반응형 Python4 Python + sqlalchemy + MariaDB | Too many connections + MariaDB Performance Tuning Open API 데이터를 크롤링해서 DB에 넣는 작업을 하는 도중에 갑자기 (pymysql.err.OperationalError) (1040, 'Too many connections') 메시지가 떴다. 몇 천 건씩 한 번에 insert 하는데 한 4~500번째쯤 되니 메시지가 뜰만도 했다.(심지어 MariaDB도 Default설정) 그래서 아래와 같이 해결. 1. sqlalchemy에 설정을 추가하였다. engine = sqlalchemy.create_engine(f'mysql+pymysql://{DB_ACCT}:{DB_SECRET}@localhost:3306/test_db', pool_size=db_pool_size, pool_recycle=db_pool_recycle, max_overflow=db_m.. 2024. 3. 27. Python about Pickle & HDF5 format | 파이썬 pickle 과 HDF5 파일 저장 형식 * Python Data를 pickle format을 활용하여 저장할 경우 버젼별로 다르게 나오기 때문에 라이브러리 버젼의 차이로 Data무결성이 보장되지 않는다. * When saving Python data using pickle format, the data integrity is not guaranteed due to the difference in the library version * HDF5(Hierarchical Data Format) 형식 대량 과학 계산용 배열 Data 저장을 위하여 고안된 포맷 C, Java, Julia, Matlab, Python 인터페이스 제공 On the fly(실시간) 압축방식 제공 => Pattern 있는 Data를 더 효과적으로 저장한다. pandas를 활용.. 2023. 8. 10. create conda env by yml file in windows | 윈도우에서 yml파일로 아나콘다 환경설정 하기 책을 통하여 공부하신다거나 github에 있는 소스로 공부하실 경우 많은 분들이 해당 환경설정에 대해서 yml파일을 만들어 올려놓는 경우가 많습니다. If you study by book or GitHub source, the author or repository owner may provide yml file that includes the environment of the programming file. 간단하게 아래와 같이 "conda env create -f 파일명"을 타이핑하시면 환경설징이 완료됩니다~ If so, just type "conda env create -f FileName' simply~ FYI: 파일 안의 Name 으로 새로운 가상환경이 생성됩니다. According to the .. 2023. 7. 26. Numpy - Transposed Matrix(전치행렬), Reverse Matrix(역행렬), and Vector usage Here is an example to explain the matrix of Numpy Library 넘피 라이브러리의 매트릭스에 대해서 쉽게 눈으로보며 넘어갈 수 있게 만든 예제입니다. import numpy as np import pandas as pd a = np.matrix([[1,2], [3,4]]) # = ('1 2;3 4') a.T : create the transposed matrix of a print(a.I) # np.matrix.I => a.I : create the reverse matrix of a Results created by np.matrix can see them below with transposed matrix, and reverse matrix. np.matrix .. 2022. 6. 28. 이전 1 다음 728x90 반응형