일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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 |
- PyQt
- flutter
- port
- 다이어트
- python
- PER
- ASP
- 맛집
- 라즈베리파이
- GIT
- tensorflow
- MySQL
- Excel
- urllib
- 날짜
- pandas
- node.js
- 함수
- 유니티
- PyQt5
- Linux
- IOS
- ubuntu
- mssql
- javascript
- Unity
- 리눅스
- sqlite
- MS-SQL
- swift
목록2025/07 (4)
아미(아름다운미소)
first_date = df.get('날짜열', pd.Series([pd.NaT])).iloc[0]
import pandas as pd# 예시: 둘 다 빈 DataFrame이지만 컬럼이 다름df1 = pd.DataFrame(columns=['a', 'b'])df2 = pd.DataFrame(columns=['b', 'c'])# 👉 모든 컬럼의 합집합 구하기all_columns = sorted(set(df1.columns).union(set(df2.columns)))# 👉 컬럼 맞춰주기 (reindex로 없으면 NaN 채움)df1 = df1.reindex(columns=all_columns)df2 = df2.reindex(columns=all_columns)# 👉 concatresult = pd.concat([df1, df2], ignore_index=True)print(result)
import pandas as pddf = pd.DataFrame({ 'a': ['2024-01-01', '2024-01-02', None]})# 문자열 → datetime으로 변환df['a'] = pd.to_datetime(df['a'], errors='coerce')# 첫 번째 값 가져오기first_val = df['a'].iloc[0] # 또는 .iat[0]print(first_val)
import requestsurl = "https://your-api-url.com/stock/signal"params = { "stock_name": "극동유화", "max_news": 50}headers = { "Authorization": "Bearer YOUR_API_KEY" # 필요 시}response = requests.post(url, json=params, headers=headers)# 응답값이 JSON이면if response.status_code == 200: res = response.json() signal = res.get("signal") # 또는 res["signal"] print("📈 Signal:", signal)else: prin..