mirror of
https://ghfast.top/https://github.com/aeroxw/easy-tdx.git
synced 2026-09-12 16:54:17 +08:00
feat: merge datetime fields in DataFrame output, hide MinuteBar internal fields
- K-line: daily+ periods output 'date' only, minute periods output 'datetime' - Transactions (tick-by-tick): combine date param + hour/minute into 'datetime' - XdxrRecord, HistoricalFundFlow: year/month/day merged to 'date' - MinuteBar: rename unknown_1 to _unknown_1 (hidden from DataFrame) - MinuteBar: add datetime column computed from bar index (A-share 240-bar pattern) - get_minute_time_data: use history endpoint only (current-day endpoint broken in pytdx too) - Update all examples to reflect new DataFrame column names
This commit is contained in:
@@ -6,16 +6,9 @@
|
||||
'block_fg.dat' - 风格板块
|
||||
"""
|
||||
|
||||
import pandas as pd
|
||||
from easy_tdx import TdxClient
|
||||
|
||||
with TdxClient.from_best_host() as c:
|
||||
blocks = c.get_block_info("block_gn.dat")
|
||||
df = pd.DataFrame([{
|
||||
"板块名称": b.name,
|
||||
"分类": b.category,
|
||||
"成分股数": b.count,
|
||||
"代码(前5)": ", ".join(b.codes[:5]),
|
||||
} for b in blocks])
|
||||
df = c.get_block_info("block_gn.dat")
|
||||
print(f"概念板块,共 {len(df)} 个:")
|
||||
print(df.head(20).to_string(index=False))
|
||||
print(df[["name", "category", "count"]].head(20).to_string(index=False))
|
||||
|
||||
Reference in New Issue
Block a user