polars-ta 0.5.6__tar.gz → 0.5.7__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {polars_ta-0.5.6 → polars_ta-0.5.7}/PKG-INFO +1 -1
- polars_ta-0.5.7/polars_ta/_version.py +1 -0
- {polars_ta-0.5.6 → polars_ta-0.5.7}/polars_ta/wq/cross_sectional.py +20 -3
- {polars_ta-0.5.6 → polars_ta-0.5.7}/polars_ta/wq/transformational.py +5 -0
- polars_ta-0.5.6/polars_ta/_version.py +0 -1
- {polars_ta-0.5.6 → polars_ta-0.5.7}/.gitignore +0 -0
- {polars_ta-0.5.6 → polars_ta-0.5.7}/LICENSE +0 -0
- {polars_ta-0.5.6 → polars_ta-0.5.7}/README.md +0 -0
- {polars_ta-0.5.6 → polars_ta-0.5.7}/polars_ta/__init__.py +0 -0
- {polars_ta-0.5.6 → polars_ta-0.5.7}/polars_ta/candles/__init__.py +0 -0
- {polars_ta-0.5.6 → polars_ta-0.5.7}/polars_ta/candles/cdl1.py +0 -0
- {polars_ta-0.5.6 → polars_ta-0.5.7}/polars_ta/candles/cdl1_limit.py +0 -0
- {polars_ta-0.5.6 → polars_ta-0.5.7}/polars_ta/candles/cdl2.py +0 -0
- {polars_ta-0.5.6 → polars_ta-0.5.7}/polars_ta/labels/__init__.py +0 -0
- {polars_ta-0.5.6 → polars_ta-0.5.7}/polars_ta/labels/_nb.py +0 -0
- {polars_ta-0.5.6 → polars_ta-0.5.7}/polars_ta/labels/future.py +0 -0
- {polars_ta-0.5.6 → polars_ta-0.5.7}/polars_ta/noise.py +0 -0
- {polars_ta-0.5.6 → polars_ta-0.5.7}/polars_ta/performance/__init__.py +0 -0
- {polars_ta-0.5.6 → polars_ta-0.5.7}/polars_ta/performance/drawdown.py +0 -0
- {polars_ta-0.5.6 → polars_ta-0.5.7}/polars_ta/performance/returns.py +0 -0
- {polars_ta-0.5.6 → polars_ta-0.5.7}/polars_ta/prefix/__init__.py +0 -0
- {polars_ta-0.5.6 → polars_ta-0.5.7}/polars_ta/prefix/cdl.py +0 -0
- {polars_ta-0.5.6 → polars_ta-0.5.7}/polars_ta/prefix/labels.py +0 -0
- {polars_ta-0.5.6 → polars_ta-0.5.7}/polars_ta/prefix/reports.py +0 -0
- {polars_ta-0.5.6 → polars_ta-0.5.7}/polars_ta/prefix/ta.py +0 -0
- {polars_ta-0.5.6 → polars_ta-0.5.7}/polars_ta/prefix/talib.py +0 -0
- {polars_ta-0.5.6 → polars_ta-0.5.7}/polars_ta/prefix/tdx.py +0 -0
- {polars_ta-0.5.6 → polars_ta-0.5.7}/polars_ta/prefix/vec.py +0 -0
- {polars_ta-0.5.6 → polars_ta-0.5.7}/polars_ta/prefix/wq.py +0 -0
- {polars_ta-0.5.6 → polars_ta-0.5.7}/polars_ta/reports/__init__.py +0 -0
- {polars_ta-0.5.6 → polars_ta-0.5.7}/polars_ta/reports/cicc.py +0 -0
- {polars_ta-0.5.6 → polars_ta-0.5.7}/polars_ta/ta/README.md +0 -0
- {polars_ta-0.5.6 → polars_ta-0.5.7}/polars_ta/ta/__init__.py +0 -0
- {polars_ta-0.5.6 → polars_ta-0.5.7}/polars_ta/ta/momentum.py +0 -0
- {polars_ta-0.5.6 → polars_ta-0.5.7}/polars_ta/ta/operators.py +0 -0
- {polars_ta-0.5.6 → polars_ta-0.5.7}/polars_ta/ta/overlap.py +0 -0
- {polars_ta-0.5.6 → polars_ta-0.5.7}/polars_ta/ta/price.py +0 -0
- {polars_ta-0.5.6 → polars_ta-0.5.7}/polars_ta/ta/statistic.py +0 -0
- {polars_ta-0.5.6 → polars_ta-0.5.7}/polars_ta/ta/transform.py +0 -0
- {polars_ta-0.5.6 → polars_ta-0.5.7}/polars_ta/ta/volatility.py +0 -0
- {polars_ta-0.5.6 → polars_ta-0.5.7}/polars_ta/ta/volume.py +0 -0
- {polars_ta-0.5.6 → polars_ta-0.5.7}/polars_ta/talib/README.md +0 -0
- {polars_ta-0.5.6 → polars_ta-0.5.7}/polars_ta/talib/__init__.py +0 -0
- {polars_ta-0.5.6 → polars_ta-0.5.7}/polars_ta/tdx/README.md +0 -0
- {polars_ta-0.5.6 → polars_ta-0.5.7}/polars_ta/tdx/__init__.py +0 -0
- {polars_ta-0.5.6 → polars_ta-0.5.7}/polars_ta/tdx/_chip.py +0 -0
- {polars_ta-0.5.6 → polars_ta-0.5.7}/polars_ta/tdx/_nb.py +0 -0
- {polars_ta-0.5.6 → polars_ta-0.5.7}/polars_ta/tdx/_slow.py +0 -0
- {polars_ta-0.5.6 → polars_ta-0.5.7}/polars_ta/tdx/arithmetic.py +0 -0
- {polars_ta-0.5.6 → polars_ta-0.5.7}/polars_ta/tdx/choice.py +0 -0
- {polars_ta-0.5.6 → polars_ta-0.5.7}/polars_ta/tdx/energy.py +0 -0
- {polars_ta-0.5.6 → polars_ta-0.5.7}/polars_ta/tdx/logical.py +0 -0
- {polars_ta-0.5.6 → polars_ta-0.5.7}/polars_ta/tdx/moving_average.py +0 -0
- {polars_ta-0.5.6 → polars_ta-0.5.7}/polars_ta/tdx/over_bought_over_sold.py +0 -0
- {polars_ta-0.5.6 → polars_ta-0.5.7}/polars_ta/tdx/pattern.py +0 -0
- {polars_ta-0.5.6 → polars_ta-0.5.7}/polars_ta/tdx/pattern_feature.py +0 -0
- {polars_ta-0.5.6 → polars_ta-0.5.7}/polars_ta/tdx/pressure_support.py +0 -0
- {polars_ta-0.5.6 → polars_ta-0.5.7}/polars_ta/tdx/reference.py +0 -0
- {polars_ta-0.5.6 → polars_ta-0.5.7}/polars_ta/tdx/statistic.py +0 -0
- {polars_ta-0.5.6 → polars_ta-0.5.7}/polars_ta/tdx/trend.py +0 -0
- {polars_ta-0.5.6 → polars_ta-0.5.7}/polars_ta/tdx/trend_feature.py +0 -0
- {polars_ta-0.5.6 → polars_ta-0.5.7}/polars_ta/tdx/volume.py +0 -0
- {polars_ta-0.5.6 → polars_ta-0.5.7}/polars_ta/utils/__init__.py +0 -0
- {polars_ta-0.5.6 → polars_ta-0.5.7}/polars_ta/utils/helper.py +0 -0
- {polars_ta-0.5.6 → polars_ta-0.5.7}/polars_ta/utils/numba_.py +0 -0
- {polars_ta-0.5.6 → polars_ta-0.5.7}/polars_ta/utils/pandas_.py +0 -0
- {polars_ta-0.5.6 → polars_ta-0.5.7}/polars_ta/utils/pit.py +0 -0
- {polars_ta-0.5.6 → polars_ta-0.5.7}/polars_ta/utils/withs.py +0 -0
- {polars_ta-0.5.6 → polars_ta-0.5.7}/polars_ta/utils/wrapper.py +0 -0
- {polars_ta-0.5.6 → polars_ta-0.5.7}/polars_ta/wq/__init__.py +0 -0
- {polars_ta-0.5.6 → polars_ta-0.5.7}/polars_ta/wq/_nb.py +0 -0
- {polars_ta-0.5.6 → polars_ta-0.5.7}/polars_ta/wq/_slow.py +0 -0
- {polars_ta-0.5.6 → polars_ta-0.5.7}/polars_ta/wq/arithmetic.py +0 -0
- {polars_ta-0.5.6 → polars_ta-0.5.7}/polars_ta/wq/logical.py +0 -0
- {polars_ta-0.5.6 → polars_ta-0.5.7}/polars_ta/wq/preprocess.py +0 -0
- {polars_ta-0.5.6 → polars_ta-0.5.7}/polars_ta/wq/time_series.py +0 -0
- {polars_ta-0.5.6 → polars_ta-0.5.7}/polars_ta/wq/vector.py +0 -0
- {polars_ta-0.5.6 → polars_ta-0.5.7}/pyproject.toml +0 -0
@@ -0,0 +1 @@
|
|
1
|
+
__version__ = "0.5.7"
|
@@ -290,7 +290,7 @@ def cs_rank(x: Expr, pct: bool = True) -> Expr:
|
|
290
290
|
|
291
291
|
|
292
292
|
def cs_rank_if(condition: Expr, x: Expr, pct: bool = True) -> Expr:
|
293
|
-
"""
|
293
|
+
"""横截面筛选排名。可实现动态票池
|
294
294
|
|
295
295
|
Parameters
|
296
296
|
----------
|
@@ -299,17 +299,34 @@ def cs_rank_if(condition: Expr, x: Expr, pct: bool = True) -> Expr:
|
|
299
299
|
x:Expr
|
300
300
|
因子
|
301
301
|
pct:bool
|
302
|
+
排名百分比。范围:[0,1]
|
302
303
|
|
303
304
|
Examples
|
304
305
|
--------
|
305
306
|
```python
|
306
307
|
df = pl.DataFrame({
|
307
308
|
'a': [None, 1, 1, 1, 2, 2, 3, 10],
|
308
|
-
'b': [1, 2, 3, 4, 5, 6,
|
309
|
+
'b': [1, 2, 3, 4, 5, 6, None, 8],
|
309
310
|
}).with_columns(
|
310
|
-
out1=cs_rank_if(True, pl.col('a'), True),
|
311
|
+
out1=cs_rank_if(True, pl.col('a'), True), # 与cs_rank等价
|
311
312
|
out2=cs_rank_if(pl.col('b') > 3, -pl.col('a'), False),
|
312
313
|
)
|
314
|
+
|
315
|
+
shape: (8, 4)
|
316
|
+
┌──────┬──────┬──────────┬──────┐
|
317
|
+
│ a ┆ b ┆ out1 ┆ out2 │
|
318
|
+
│ --- ┆ --- ┆ --- ┆ --- │
|
319
|
+
│ i64 ┆ i64 ┆ f64 ┆ u32 │
|
320
|
+
╞══════╪══════╪══════════╪══════╡
|
321
|
+
│ null ┆ 1 ┆ null ┆ null │
|
322
|
+
│ 1 ┆ 2 ┆ 0.0 ┆ null │
|
323
|
+
│ 1 ┆ 3 ┆ 0.0 ┆ null │
|
324
|
+
│ 1 ┆ 4 ┆ 0.0 ┆ 3 │
|
325
|
+
│ 2 ┆ 5 ┆ 0.333333 ┆ 2 │
|
326
|
+
│ 2 ┆ 6 ┆ 0.333333 ┆ 2 │
|
327
|
+
│ 3 ┆ null ┆ 0.666667 ┆ null │
|
328
|
+
│ 10 ┆ 8 ┆ 1.0 ┆ 1 │
|
329
|
+
└──────┴──────┴──────────┴──────┘
|
313
330
|
```
|
314
331
|
|
315
332
|
Notes
|
@@ -1 +0,0 @@
|
|
1
|
-
__version__ = "0.5.6"
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|