일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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 |
- mssql
- tensorflow
- Unity
- 맛집
- MySQL
- javascript
- PyQt
- PyQt5
- MS-SQL
- ASP
- 날짜
- 다이어트
- swift
- Linux
- IOS
- python
- flutter
- GIT
- PER
- 함수
- 리눅스
- pandas
- Excel
- 라즈베리파이
- urllib
- ubuntu
- sqlite
- 유니티
- port
- node.js
목록2025/08 (7)
아미(아름다운미소)
from openpyxl import Workbookfrom openpyxl.styles import Alignment, Font# 새 워크북 생성wb = Workbook()# 운동 시트ws = wb.activews.title = "운동 플랜"# 열 너비 조정columns = ['A', 'B', 'C', 'D', 'E']for col in columns: ws.column_dimensions[col].width = 25# 헤더headers = ["구분", "운동", "횟수/시간", "세트", "비고"]ws.append(headers)for cell in ws[1]: cell.alignment = Alignment(horizontal='center', vertical='center') ce..
import pandas as pdimport requestsfrom typing import Optional, Dict, Any, Tupleimport warningswarnings.filterwarnings('ignore')class EnhancedFinancialAnalyzer: """네이버 금융 재무제표 분석기 - 확장된 재무비율 포함""" def __init__(self): self.headers = { 'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/91.0.4472.124 Safari/537.36' } ..
import pandas as pdimport requestsfrom typing import Optional, Dict, Any, Tupleimport warningswarnings.filterwarnings('ignore')class EnhancedFinancialAnalyzer: """네이버 금융 재무제표 분석기 - 확장된 재무비율 포함""" def __init__(self): self.headers = { 'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/91.0.4472.124 Safari/537.36' } ..
import pandas as pdimport requestsfrom typing import Optional, Dict, Anyimport warningswarnings.filterwarnings('ignore')class FinancialAnalyzer: """네이버 금융 재무제표 분석기""" def __init__(self): self.headers = { 'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/91.0.4472.124 Safari/537.36' } def get_financial_..
import pandas as pdimport requestsdef get_financial_statement(ticker): """ 네이버 금융에서 손익계산서 데이터를 가져오는 함수 """ url = f'https://finance.naver.com/item/main.naver?code={ticker}' try: tables = pd.read_html(url, encoding='euc-kr') except: return None for table in tables: if table.shape[1] >= 3 and '매출액' in table.iloc[:, 0].values: return table retu..
import pandas as pd# 예시 데이터프레임 생성 (실제 사용시에는 주석 처리)data = { 'a': [1, 1, 1, 2, 2, 2], 'b': ['x', 'x', 'y', 'y', 'y', 'y'], 'c': [10, 10, 20, 20, 20, 30], 'd': [100, 100, 200, 300, 300, 400]}df = pd.DataFrame(data)# 그룹별로 d 컬럼의 최빈값 계산 (동률일 경우 최소값 선택)result = df.groupby(['a', 'b', 'c'])['d'].agg( lambda x: x.mode().min() if not x.mode().empty else None).reset_index()print(result)
import pandas as pd# 예제 데이터 생성df1 = pd.DataFrame({ 'a': [1, 2, 3], 'b': ['x', 'y', 'z'], 'c': [0.1, 0.2, 0.3]})df2 = pd.DataFrame({ 'd': [10, 20]})# 크로스 조인 수행 (방법 1)cross_join = df1.assign(key=1).merge(df2.assign(key=1), on='key').drop('key', axis=1)# 크로스 조인 수행 (방법 2 - pandas 1.2.0+)cross_join = df1.merge(df2, how='cross')print(cross_join)