일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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 |
- 날짜
- Linux
- urllib
- Unity
- 함수
- sqlite
- MS-SQL
- 유니티
- ubuntu
- PyQt
- ASP
- MySQL
- mssql
- flutter
- 라즈베리파이
- tensorflow
- javascript
- node.js
- port
- GIT
- 다이어트
- Excel
- 맛집
- 리눅스
- PER
- python
- swift
- IOS
- PyQt5
- pandas
목록2025/04 (3)
아미(아름다운미소)
예제1import pandas as pd# --------------------------------------------# 1. 샘플 데이터 생성# --------------------------------------------df = pd.DataFrame({ 'a': [1, 2, 3, 4], 'b': ['A', 'B', 'C', 'D'], 'c': [10, 20, 30, 40]})df2 = pd.DataFrame({ 'a': [1, 2, 3, 5], 'b': ['A', 'X', 'C', 'E'], 'c': [10, 20, 30, 50]})# --------------------------------------------# 2. 비교 방법 구현# ------------..
최적화 최존def process_dataframe_optimized(dict_df_types, df): type_handlers = { 'int': lambda s: pd.to_numeric(s, errors='coerce').fillna(0).astype('int32'), 'float': lambda s: pd.to_numeric(s, errors='coerce').fillna(0).astype('float32'), # float32로 변경 'bool': lambda s: s.astype(str).str.lower().isin(['true', 't', '1']), # 더 넓은 불리언 조건 'datetime': lambda s: pd.to_dat..