AnomalyLab 0.3.8__tar.gz → 0.3.9__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.
- {anomalylab-0.3.8 → anomalylab-0.3.9/AnomalyLab.egg-info}/PKG-INFO +5 -7
- {anomalylab-0.3.8/AnomalyLab.egg-info → anomalylab-0.3.9}/PKG-INFO +5 -7
- {anomalylab-0.3.8 → anomalylab-0.3.9}/README.md +4 -6
- {anomalylab-0.3.8 → anomalylab-0.3.9}/anomalylab/core/core.py +2 -1
- {anomalylab-0.3.8 → anomalylab-0.3.9}/setup.py +1 -1
- {anomalylab-0.3.8 → anomalylab-0.3.9}/.gitattributes +0 -0
- {anomalylab-0.3.8 → anomalylab-0.3.9}/.github/workflows/python-publish.yml +0 -0
- {anomalylab-0.3.8 → anomalylab-0.3.9}/.gitignore +0 -0
- {anomalylab-0.3.8 → anomalylab-0.3.9}/AnomalyLab.egg-info/SOURCES.txt +0 -0
- {anomalylab-0.3.8 → anomalylab-0.3.9}/AnomalyLab.egg-info/dependency_links.txt +0 -0
- {anomalylab-0.3.8 → anomalylab-0.3.9}/AnomalyLab.egg-info/requires.txt +0 -0
- {anomalylab-0.3.8 → anomalylab-0.3.9}/AnomalyLab.egg-info/top_level.txt +0 -0
- {anomalylab-0.3.8 → anomalylab-0.3.9}/LICENSE +0 -0
- {anomalylab-0.3.8 → anomalylab-0.3.9}/MANIFEST.in +0 -0
- {anomalylab-0.3.8 → anomalylab-0.3.9}/anomalylab/__init__.py +0 -0
- {anomalylab-0.3.8 → anomalylab-0.3.9}/anomalylab/config.py +0 -0
- {anomalylab-0.3.8 → anomalylab-0.3.9}/anomalylab/core/__init__.py +0 -0
- {anomalylab-0.3.8 → anomalylab-0.3.9}/anomalylab/datasets/__init__.py +0 -0
- {anomalylab-0.3.8 → anomalylab-0.3.9}/anomalylab/datasets/dataset.py +0 -0
- {anomalylab-0.3.8 → anomalylab-0.3.9}/anomalylab/datasets/panel_data.csv +0 -0
- {anomalylab-0.3.8 → anomalylab-0.3.9}/anomalylab/datasets/time_series_data.csv +0 -0
- {anomalylab-0.3.8 → anomalylab-0.3.9}/anomalylab/empirical/__init__.py +0 -0
- {anomalylab-0.3.8 → anomalylab-0.3.9}/anomalylab/empirical/correlation.py +0 -0
- {anomalylab-0.3.8 → anomalylab-0.3.9}/anomalylab/empirical/empirical.py +0 -0
- {anomalylab-0.3.8 → anomalylab-0.3.9}/anomalylab/empirical/fm_regression.py +0 -0
- {anomalylab-0.3.8 → anomalylab-0.3.9}/anomalylab/empirical/persistence.py +0 -0
- {anomalylab-0.3.8 → anomalylab-0.3.9}/anomalylab/empirical/portfolio.py +0 -0
- {anomalylab-0.3.8 → anomalylab-0.3.9}/anomalylab/empirical/summary.py +0 -0
- {anomalylab-0.3.8 → anomalylab-0.3.9}/anomalylab/preprocess/__init__.py +0 -0
- {anomalylab-0.3.8 → anomalylab-0.3.9}/anomalylab/preprocess/fillna.py +0 -0
- {anomalylab-0.3.8 → anomalylab-0.3.9}/anomalylab/preprocess/normalize.py +0 -0
- {anomalylab-0.3.8 → anomalylab-0.3.9}/anomalylab/preprocess/outliers.py +0 -0
- {anomalylab-0.3.8 → anomalylab-0.3.9}/anomalylab/preprocess/preprocessor.py +0 -0
- {anomalylab-0.3.8 → anomalylab-0.3.9}/anomalylab/preprocess/shift.py +0 -0
- {anomalylab-0.3.8 → anomalylab-0.3.9}/anomalylab/preprocess/truncate.py +0 -0
- {anomalylab-0.3.8 → anomalylab-0.3.9}/anomalylab/structure/__init__.py +0 -0
- {anomalylab-0.3.8 → anomalylab-0.3.9}/anomalylab/structure/data.py +0 -0
- {anomalylab-0.3.8 → anomalylab-0.3.9}/anomalylab/structure/panel_data.py +0 -0
- {anomalylab-0.3.8 → anomalylab-0.3.9}/anomalylab/structure/time_series.py +0 -0
- {anomalylab-0.3.8 → anomalylab-0.3.9}/anomalylab/utils/__init__.py +0 -0
- {anomalylab-0.3.8 → anomalylab-0.3.9}/anomalylab/utils/imports.py +0 -0
- {anomalylab-0.3.8 → anomalylab-0.3.9}/anomalylab/utils/utils.py +0 -0
- {anomalylab-0.3.8 → anomalylab-0.3.9}/anomalylab/visualization/__init__.py +0 -0
- {anomalylab-0.3.8 → anomalylab-0.3.9}/anomalylab/visualization/format.py +0 -0
- {anomalylab-0.3.8 → anomalylab-0.3.9}/requirements.txt +0 -0
- {anomalylab-0.3.8 → anomalylab-0.3.9}/setup.cfg +0 -0
- {anomalylab-0.3.8 → anomalylab-0.3.9}/tests/__init__.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: AnomalyLab
|
|
3
|
-
Version: 0.3.
|
|
3
|
+
Version: 0.3.9
|
|
4
4
|
Summary: A Python package for empirical asset pricing analysis.
|
|
5
5
|
Author: FinPhd
|
|
6
6
|
Classifier: Programming Language :: Python :: 3
|
|
@@ -61,8 +61,6 @@ This package provides a comprehensive suite of tools for empirical asset pricing
|
|
|
61
61
|
### Importing Data
|
|
62
62
|
|
|
63
63
|
```python
|
|
64
|
-
from importlib import resources
|
|
65
|
-
|
|
66
64
|
import pandas as pd
|
|
67
65
|
from pandas import DataFrame
|
|
68
66
|
|
|
@@ -93,8 +91,8 @@ panel = Panel(
|
|
|
93
91
|
)
|
|
94
92
|
time_series: TimeSeries = TimeSeries(
|
|
95
93
|
df=ts, name="Factor Series", time="date", frequency="M", is_copy=False
|
|
96
|
-
pp(panel)
|
|
97
94
|
)
|
|
95
|
+
pp(panel)
|
|
98
96
|
```
|
|
99
97
|
|
|
100
98
|
### Preprocessing Data
|
|
@@ -106,7 +104,7 @@ Several preprocessing functions are available for handling missing values, norma
|
|
|
106
104
|
# Filling Group Columns
|
|
107
105
|
panel.fill_group_column(group_column="industry", value="Other")
|
|
108
106
|
# Filling Missing Values
|
|
109
|
-
panel.fillna(method="mean", group_columns="date")
|
|
107
|
+
panel.fillna(method="mean", value=0, group_columns="date")
|
|
110
108
|
|
|
111
109
|
# Normalizing Data:
|
|
112
110
|
# panel.normalize(method="zscore", group_columns="date")
|
|
@@ -115,7 +113,7 @@ panel.fillna(method="mean", group_columns="date")
|
|
|
115
113
|
# panel.shift(periods=1, drop_original=False)
|
|
116
114
|
|
|
117
115
|
# Winsorizing Data:
|
|
118
|
-
panel.winsorize(method="winsorize")
|
|
116
|
+
panel.winsorize(method="winsorize", group_columns="date")
|
|
119
117
|
pp(panel)
|
|
120
118
|
```
|
|
121
119
|
|
|
@@ -144,7 +142,7 @@ The persistence() function computes persistence for a given set of periods to an
|
|
|
144
142
|
The transition_matrix() function calculates the transition matrix to evaluate how a variable moves between different states (e.g., deciles) over time.
|
|
145
143
|
|
|
146
144
|
```python
|
|
147
|
-
|
|
145
|
+
persistence = panel.persistence(periods=[1, 3, 6, 12, 36, 60])
|
|
148
146
|
pp(persistence)
|
|
149
147
|
pp(
|
|
150
148
|
panel.transition_matrix(
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: AnomalyLab
|
|
3
|
-
Version: 0.3.
|
|
3
|
+
Version: 0.3.9
|
|
4
4
|
Summary: A Python package for empirical asset pricing analysis.
|
|
5
5
|
Author: FinPhd
|
|
6
6
|
Classifier: Programming Language :: Python :: 3
|
|
@@ -61,8 +61,6 @@ This package provides a comprehensive suite of tools for empirical asset pricing
|
|
|
61
61
|
### Importing Data
|
|
62
62
|
|
|
63
63
|
```python
|
|
64
|
-
from importlib import resources
|
|
65
|
-
|
|
66
64
|
import pandas as pd
|
|
67
65
|
from pandas import DataFrame
|
|
68
66
|
|
|
@@ -93,8 +91,8 @@ panel = Panel(
|
|
|
93
91
|
)
|
|
94
92
|
time_series: TimeSeries = TimeSeries(
|
|
95
93
|
df=ts, name="Factor Series", time="date", frequency="M", is_copy=False
|
|
96
|
-
pp(panel)
|
|
97
94
|
)
|
|
95
|
+
pp(panel)
|
|
98
96
|
```
|
|
99
97
|
|
|
100
98
|
### Preprocessing Data
|
|
@@ -106,7 +104,7 @@ Several preprocessing functions are available for handling missing values, norma
|
|
|
106
104
|
# Filling Group Columns
|
|
107
105
|
panel.fill_group_column(group_column="industry", value="Other")
|
|
108
106
|
# Filling Missing Values
|
|
109
|
-
panel.fillna(method="mean", group_columns="date")
|
|
107
|
+
panel.fillna(method="mean", value=0, group_columns="date")
|
|
110
108
|
|
|
111
109
|
# Normalizing Data:
|
|
112
110
|
# panel.normalize(method="zscore", group_columns="date")
|
|
@@ -115,7 +113,7 @@ panel.fillna(method="mean", group_columns="date")
|
|
|
115
113
|
# panel.shift(periods=1, drop_original=False)
|
|
116
114
|
|
|
117
115
|
# Winsorizing Data:
|
|
118
|
-
panel.winsorize(method="winsorize")
|
|
116
|
+
panel.winsorize(method="winsorize", group_columns="date")
|
|
119
117
|
pp(panel)
|
|
120
118
|
```
|
|
121
119
|
|
|
@@ -144,7 +142,7 @@ The persistence() function computes persistence for a given set of periods to an
|
|
|
144
142
|
The transition_matrix() function calculates the transition matrix to evaluate how a variable moves between different states (e.g., deciles) over time.
|
|
145
143
|
|
|
146
144
|
```python
|
|
147
|
-
|
|
145
|
+
persistence = panel.persistence(periods=[1, 3, 6, 12, 36, 60])
|
|
148
146
|
pp(persistence)
|
|
149
147
|
pp(
|
|
150
148
|
panel.transition_matrix(
|
|
@@ -38,8 +38,6 @@ This package provides a comprehensive suite of tools for empirical asset pricing
|
|
|
38
38
|
### Importing Data
|
|
39
39
|
|
|
40
40
|
```python
|
|
41
|
-
from importlib import resources
|
|
42
|
-
|
|
43
41
|
import pandas as pd
|
|
44
42
|
from pandas import DataFrame
|
|
45
43
|
|
|
@@ -70,8 +68,8 @@ panel = Panel(
|
|
|
70
68
|
)
|
|
71
69
|
time_series: TimeSeries = TimeSeries(
|
|
72
70
|
df=ts, name="Factor Series", time="date", frequency="M", is_copy=False
|
|
73
|
-
pp(panel)
|
|
74
71
|
)
|
|
72
|
+
pp(panel)
|
|
75
73
|
```
|
|
76
74
|
|
|
77
75
|
### Preprocessing Data
|
|
@@ -83,7 +81,7 @@ Several preprocessing functions are available for handling missing values, norma
|
|
|
83
81
|
# Filling Group Columns
|
|
84
82
|
panel.fill_group_column(group_column="industry", value="Other")
|
|
85
83
|
# Filling Missing Values
|
|
86
|
-
panel.fillna(method="mean", group_columns="date")
|
|
84
|
+
panel.fillna(method="mean", value=0, group_columns="date")
|
|
87
85
|
|
|
88
86
|
# Normalizing Data:
|
|
89
87
|
# panel.normalize(method="zscore", group_columns="date")
|
|
@@ -92,7 +90,7 @@ panel.fillna(method="mean", group_columns="date")
|
|
|
92
90
|
# panel.shift(periods=1, drop_original=False)
|
|
93
91
|
|
|
94
92
|
# Winsorizing Data:
|
|
95
|
-
panel.winsorize(method="winsorize")
|
|
93
|
+
panel.winsorize(method="winsorize", group_columns="date")
|
|
96
94
|
pp(panel)
|
|
97
95
|
```
|
|
98
96
|
|
|
@@ -121,7 +119,7 @@ The persistence() function computes persistence for a given set of periods to an
|
|
|
121
119
|
The transition_matrix() function calculates the transition matrix to evaluate how a variable moves between different states (e.g., deciles) over time.
|
|
122
120
|
|
|
123
121
|
```python
|
|
124
|
-
|
|
122
|
+
persistence = panel.persistence(periods=[1, 3, 6, 12, 36, 60])
|
|
125
123
|
pp(persistence)
|
|
126
124
|
pp(
|
|
127
125
|
panel.transition_matrix(
|
|
@@ -710,6 +710,7 @@ if __name__ == "__main__":
|
|
|
710
710
|
panel.fillna(
|
|
711
711
|
# columns="MktCap",
|
|
712
712
|
method="mean",
|
|
713
|
+
value=0,
|
|
713
714
|
group_columns="date",
|
|
714
715
|
# no_process_columns="MktCap",
|
|
715
716
|
# process_all_characteristics=True,
|
|
@@ -723,7 +724,7 @@ if __name__ == "__main__":
|
|
|
723
724
|
# )
|
|
724
725
|
# panel.shift(periods=1, drop_original=False)
|
|
725
726
|
|
|
726
|
-
panel.winsorize(method="winsorize")
|
|
727
|
+
panel.winsorize(method="winsorize", group_columns="date")
|
|
727
728
|
pp(panel)
|
|
728
729
|
|
|
729
730
|
summary = panel.summary()
|
|
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
|