81 lines
1.8 KiB
Plaintext
81 lines
1.8 KiB
Plaintext
|
|
{
|
||
|
|
"cells": [
|
||
|
|
{
|
||
|
|
"cell_type": "code",
|
||
|
|
"id": "initial_id",
|
||
|
|
"metadata": {
|
||
|
|
"collapsed": true,
|
||
|
|
"ExecuteTime": {
|
||
|
|
"end_time": "2025-10-17T07:14:47.275Z",
|
||
|
|
"start_time": "2025-10-17T07:14:46.966401Z"
|
||
|
|
}
|
||
|
|
},
|
||
|
|
"source": [
|
||
|
|
"from operator import index\n",
|
||
|
|
"\n",
|
||
|
|
"import tushare as ts\n",
|
||
|
|
"import pandas as pd\n",
|
||
|
|
"import time\n",
|
||
|
|
"\n",
|
||
|
|
"ts.set_token('3a0741c702ee7e5e5f2bf1f0846bafaafe4e320833240b2a7e4a685f')\n",
|
||
|
|
"pro = ts.pro_api()"
|
||
|
|
],
|
||
|
|
"outputs": [],
|
||
|
|
"execution_count": 1
|
||
|
|
},
|
||
|
|
{
|
||
|
|
"metadata": {
|
||
|
|
"ExecuteTime": {
|
||
|
|
"end_time": "2025-10-17T07:15:47.631705Z",
|
||
|
|
"start_time": "2025-10-17T07:15:47.491485Z"
|
||
|
|
}
|
||
|
|
},
|
||
|
|
"cell_type": "code",
|
||
|
|
"source": [
|
||
|
|
"pro = ts.pro_api()\n",
|
||
|
|
"\n",
|
||
|
|
"#获取单个股票数据\n",
|
||
|
|
"df = pro.stk_limit(ts_code='603106.SH', start_date='20240924', end_date='20240928')\n",
|
||
|
|
"\n",
|
||
|
|
"print(df)"
|
||
|
|
],
|
||
|
|
"id": "72dcf1a049d09818",
|
||
|
|
"outputs": [
|
||
|
|
{
|
||
|
|
"name": "stdout",
|
||
|
|
"output_type": "stream",
|
||
|
|
"text": [
|
||
|
|
" trade_date ts_code up_limit down_limit\n",
|
||
|
|
"0 20240927 603106.SH 7.71 6.31\n",
|
||
|
|
"1 20240926 603106.SH 7.01 5.73\n",
|
||
|
|
"2 20240925 603106.SH 6.37 5.21\n",
|
||
|
|
"3 20240924 603106.SH 5.79 4.73\n"
|
||
|
|
]
|
||
|
|
}
|
||
|
|
],
|
||
|
|
"execution_count": 6
|
||
|
|
}
|
||
|
|
],
|
||
|
|
"metadata": {
|
||
|
|
"kernelspec": {
|
||
|
|
"display_name": "Python 3",
|
||
|
|
"language": "python",
|
||
|
|
"name": "python3"
|
||
|
|
},
|
||
|
|
"language_info": {
|
||
|
|
"codemirror_mode": {
|
||
|
|
"name": "ipython",
|
||
|
|
"version": 2
|
||
|
|
},
|
||
|
|
"file_extension": ".py",
|
||
|
|
"mimetype": "text/x-python",
|
||
|
|
"name": "python",
|
||
|
|
"nbconvert_exporter": "python",
|
||
|
|
"pygments_lexer": "ipython2",
|
||
|
|
"version": "2.7.6"
|
||
|
|
}
|
||
|
|
},
|
||
|
|
"nbformat": 4,
|
||
|
|
"nbformat_minor": 5
|
||
|
|
}
|