{
"cells": [
{
"cell_type": "code",
"execution_count": null,
"id": "dd67dcdf",
"metadata": {},
"outputs": [],
"source": [
"import pygwalker as pyg\n",
"import polars as pl\n",
"df = pl.read_csv('./298040/day/candle-day-250.csv',try_parse_dates = True)\n",
"gwalker = pyg.walk(df)\n"
]
},
{
"cell_type": "code",
"execution_count": 2,
"id": "f22b1844",
"metadata": {},
"outputs": [
{
"data": {
"text/html": [
"
\n",
"
shape: (14, 13)| stockBusinessDate | stockClosingPrice | stockOpenningPrice | highestStockPrice | lowestStockPrice | accumulatedVolume | accumulatedTradingAmount | exDivision | partitionRate | partitionModifiable | previousDayVariableRatioSign | previousDayVariableRatio | revaluationIssueReason |
|---|
| i64 | i64 | i64 | i64 | i64 | i64 | i64 | i64 | f64 | str | i64 | i64 | str |
| 20230615 | 91200 | 91200 | 91200 | 91200 | 0 | 0 | 0 | 0.0 | "Y" | 0 | 0 | null |
| 20230614 | 91200 | 93000 | 93500 | 89700 | 91400 | 8355483800 | 0 | 0.0 | "Y" | 5 | -1800 | null |
| 20230613 | 93000 | 94400 | 96100 | 92500 | 58177 | 5474920900 | 0 | 0.0 | "Y" | 5 | -1400 | null |
| 20230612 | 94400 | 95100 | 96000 | 92500 | 90459 | 8527275800 | 0 | 0.0 | "Y" | 5 | -1100 | null |
| 20230609 | 95500 | 91600 | 95500 | 91600 | 153317 | 14460674700 | 0 | 0.0 | "Y" | 2 | 4800 | null |
| 20230608 | 90700 | 90400 | 93200 | 89900 | 111594 | 10221020300 | 0 | 0.0 | "Y" | 2 | 700 | null |
| 20230607 | 90000 | 87700 | 91700 | 86600 | 130728 | 11727784400 | 0 | 0.0 | "Y" | 2 | 2000 | null |
| 20230605 | 88000 | 88200 | 88900 | 87000 | 76802 | 6752970000 | 0 | 0.0 | "Y" | 5 | -300 | null |
| 20230602 | 88300 | 83200 | 88500 | 82700 | 197737 | 17174200500 | 0 | 0.0 | "Y" | 2 | 6600 | null |
| 20230601 | 81700 | 79600 | 82400 | 79500 | 58524 | 4764621000 | 0 | 0.0 | "Y" | 2 | 1700 | null |
| 20230531 | 80000 | 80100 | 82300 | 79900 | 72863 | 5918119600 | 0 | 0.0 | "Y" | 5 | -600 | null |
| 20230530 | 80600 | 78700 | 81000 | 78700 | 42843 | 3430568900 | 0 | 0.0 | "Y" | 2 | 1300 | null |
| 20230526 | 79300 | 81400 | 82100 | 79100 | 63816 | 5100281800 | 0 | 0.0 | "Y" | 5 | -2200 | null |
| 20230525 | 81500 | 84000 | 84800 | 81400 | 68134 | 5642073400 | 0 | 0.0 | "Y" | 5 | -2900 | null |
"
],
"text/plain": [
"shape: (14, 13)\n",
"┌────────────┬────────────┬────────────┬────────────┬───┬────────────┬────────────┬────────────┬────────────┐\n",
"│ stockBusin ┆ stockClosi ┆ stockOpenn ┆ highestSto ┆ … ┆ partitionM ┆ previousDa ┆ previousDa ┆ revaluatio │\n",
"│ essDate ┆ ngPrice ┆ ingPrice ┆ ckPrice ┆ ┆ odifiable ┆ yVariableR ┆ yVariableR ┆ nIssueReas │\n",
"│ --- ┆ --- ┆ --- ┆ --- ┆ ┆ --- ┆ atioSign ┆ atio ┆ on │\n",
"│ i64 ┆ i64 ┆ i64 ┆ i64 ┆ ┆ str ┆ --- ┆ --- ┆ --- │\n",
"│ ┆ ┆ ┆ ┆ ┆ ┆ i64 ┆ i64 ┆ str │\n",
"╞════════════╪════════════╪════════════╪════════════╪═══╪════════════╪════════════╪════════════╪════════════╡\n",
"│ 20230615 ┆ 91200 ┆ 91200 ┆ 91200 ┆ … ┆ Y ┆ 0 ┆ 0 ┆ null │\n",
"│ 20230614 ┆ 91200 ┆ 93000 ┆ 93500 ┆ … ┆ Y ┆ 5 ┆ -1800 ┆ null │\n",
"│ 20230613 ┆ 93000 ┆ 94400 ┆ 96100 ┆ … ┆ Y ┆ 5 ┆ -1400 ┆ null │\n",
"│ 20230612 ┆ 94400 ┆ 95100 ┆ 96000 ┆ … ┆ Y ┆ 5 ┆ -1100 ┆ null │\n",
"│ … ┆ … ┆ … ┆ … ┆ … ┆ … ┆ … ┆ … ┆ … │\n",
"│ 20230531 ┆ 80000 ┆ 80100 ┆ 82300 ┆ … ┆ Y ┆ 5 ┆ -600 ┆ null │\n",
"│ 20230530 ┆ 80600 ┆ 78700 ┆ 81000 ┆ … ┆ Y ┆ 2 ┆ 1300 ┆ null │\n",
"│ 20230526 ┆ 79300 ┆ 81400 ┆ 82100 ┆ … ┆ Y ┆ 5 ┆ -2200 ┆ null │\n",
"│ 20230525 ┆ 81500 ┆ 84000 ┆ 84800 ┆ … ┆ Y ┆ 5 ┆ -2900 ┆ null │\n",
"└────────────┴────────────┴────────────┴────────────┴───┴────────────┴────────────┴────────────┴────────────┘"
]
},
"execution_count": 2,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"df.sort(\"stockBusinessDate\", descending=True).limit(14)"
]
},
{
"cell_type": "code",
"execution_count": 42,
"id": "175e5213",
"metadata": {},
"outputs": [
{
"data": {
"text/html": [
""
],
"text/plain": [
"shape: (1, 2)\n",
"┌───────┬────────┐\n",
"│ up ┆ down │\n",
"│ --- ┆ --- │\n",
"│ i64 ┆ i64 │\n",
"╞═══════╪════════╡\n",
"│ 17100 ┆ -10300 │\n",
"└───────┴────────┘"
]
},
"execution_count": 42,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"\n",
"def up(val: int) -> int:\n",
" if val > 0 :\n",
" return val\n",
" else:\n",
" return 0\n",
"\n",
"def down(val: int) -> int:\n",
" if val < 0 :\n",
" return val\n",
" else: return 0\n",
"\n",
"#df.sort(\"stockBusinessDate\", descending=True).select([pl.col(\"previousDayVariableRatio\").apply(up).sum().alias(\"up\"), pl.col(\"previousDayVariableRatio\").apply(down).sum().alias(\"down\")]).limit(14)\n",
"df.sort(\"stockBusinessDate\", descending=True).limit(14).select([pl.col(\"previousDayVariableRatio\").apply(up).sum().alias(\"up\"), pl.col(\"previousDayVariableRatio\").apply(down).sum().alias(\"down\")])"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "01cfce5c",
"metadata": {},
"outputs": [],
"source": []
},
{
"cell_type": "code",
"execution_count": null,
"id": "bfaec855",
"metadata": {},
"outputs": [],
"source": []
},
{
"cell_type": "code",
"execution_count": null,
"id": "dde44c3d",
"metadata": {},
"outputs": [],
"source": []
},
{
"cell_type": "code",
"execution_count": null,
"id": "10cf7163",
"metadata": {},
"outputs": [],
"source": []
}
],
"metadata": {
"kernelspec": {
"display_name": "Python 3 (ipykernel)",
"language": "python",
"name": "python3"
},
"language_info": {
"codemirror_mode": {
"name": "ipython",
"version": 3
},
"file_extension": ".py",
"mimetype": "text/x-python",
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.11.3"
}
},
"nbformat": 4,
"nbformat_minor": 5
}