일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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 |
- 맛집
- mssql
- PER
- MySQL
- MS-SQL
- Unity
- node.js
- 유니티
- Linux
- 함수
- 라즈베리파이
- 다이어트
- PyQt5
- GIT
- flutter
- pandas
- Excel
- 날짜
- javascript
- urllib
- sqlite
- swift
- python
- ASP
- ubuntu
- IOS
- port
- PyQt
- tensorflow
- 리눅스
목록2025/06/12 (3)
아미(아름다운미소)
python -m cProfile -o profile_results.prof your_script.pypython -m pstats profile_results.prof
import numpy as npimport pandas as pdfrom numba import njit@njitdef numba_select(condlist, choicelist, default=0): output = np.full(condlist[0].shape, default) for cond, choice in zip(reversed(condlist), reversed(choicelist)): output = np.where(cond, choice, output) return output # NumPy 배열 반환# 예시 데이터condlist = [np.array([True, False, False]), np.array([False, True, False])]choi..
import numpy as npimport pandas as pdimport multiprocessing as mpfrom functools import partialdef process_chunk(df_chunk, conditions, choices, default): # 각 청크에 np.select 적용 result = np.select(conditions, choices, default=default) return pd.Series(result, index=df_chunk.index)def parallel_select(df, conditions, choices, default='default', num_processes=None): if num_processes is None..