PythonTsa 1.4.7__tar.gz → 1.4.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.

Potentially problematic release.


This version of PythonTsa might be problematic. Click here for more details.

Files changed (64) hide show
  1. {PythonTsa-1.4.7 → pythontsa-1.4.9}/PKG-INFO +9 -2
  2. {PythonTsa-1.4.7 → pythontsa-1.4.9}/setup.py +1 -1
  3. PythonTsa-1.4.7/src/PythonTsa/Utils.py → pythontsa-1.4.9/src/PythonTsa/TsTensor.py +25 -24
  4. pythontsa-1.4.9/src/PythonTsa/__init__.py +1 -0
  5. {PythonTsa-1.4.7 → pythontsa-1.4.9}/src/PythonTsa.egg-info/PKG-INFO +9 -2
  6. {PythonTsa-1.4.7 → pythontsa-1.4.9}/src/PythonTsa.egg-info/SOURCES.txt +1 -1
  7. PythonTsa-1.4.7/src/PythonTsa/__init__.py +0 -1
  8. {PythonTsa-1.4.7 → pythontsa-1.4.9}/README.md +0 -0
  9. {PythonTsa-1.4.7 → pythontsa-1.4.9}/pyproject.toml +0 -0
  10. {PythonTsa-1.4.7 → pythontsa-1.4.9}/setup.cfg +0 -0
  11. {PythonTsa-1.4.7 → pythontsa-1.4.9}/src/PythonTsa/CheckStationarynInvertible.py +0 -0
  12. {PythonTsa-1.4.7 → pythontsa-1.4.9}/src/PythonTsa/CointegrationTest.py +0 -0
  13. {PythonTsa-1.4.7 → pythontsa-1.4.9}/src/PythonTsa/LjungBoxtest.py +0 -0
  14. {PythonTsa-1.4.7 → pythontsa-1.4.9}/src/PythonTsa/ModResidDiag.py +0 -0
  15. {PythonTsa-1.4.7 → pythontsa-1.4.9}/src/PythonTsa/MultiCorrPvalue.py +0 -0
  16. {PythonTsa-1.4.7 → pythontsa-1.4.9}/src/PythonTsa/Ptsadata/AntidiabeticDrugSales.csv +0 -0
  17. {PythonTsa-1.4.7 → pythontsa-1.4.9}/src/PythonTsa/Ptsadata/AustraliaEmployedTotalPersons.xlsx +0 -0
  18. {PythonTsa-1.4.7 → pythontsa-1.4.9}/src/PythonTsa/Ptsadata/AustraliaUnemployedTotalPersons.xlsx +0 -0
  19. {PythonTsa-1.4.7 → pythontsa-1.4.9}/src/PythonTsa/Ptsadata/BitcoinPrice17-6-23-18-6-22.xlsx +0 -0
  20. {PythonTsa-1.4.7 → pythontsa-1.4.9}/src/PythonTsa/Ptsadata/DAX.csv +0 -0
  21. {PythonTsa-1.4.7 → pythontsa-1.4.9}/src/PythonTsa/Ptsadata/DAXlogret.csv +0 -0
  22. {PythonTsa-1.4.7 → pythontsa-1.4.9}/src/PythonTsa/Ptsadata/EconGermany.dat +0 -0
  23. {PythonTsa-1.4.7 → pythontsa-1.4.9}/src/PythonTsa/Ptsadata/ExchRate NZ per UK.txt +0 -0
  24. {PythonTsa-1.4.7 → pythontsa-1.4.9}/src/PythonTsa/Ptsadata/Global mean surface air temp changes 1880-1985.csv +0 -0
  25. {PythonTsa-1.4.7 → pythontsa-1.4.9}/src/PythonTsa/Ptsadata/GlobalTemperature.txt +0 -0
  26. {PythonTsa-1.4.7 → pythontsa-1.4.9}/src/PythonTsa/Ptsadata/IBM.csv +0 -0
  27. {PythonTsa-1.4.7 → pythontsa-1.4.9}/src/PythonTsa/Ptsadata/Noboyngirl.csv +0 -0
  28. {PythonTsa-1.4.7 → pythontsa-1.4.9}/src/PythonTsa/Ptsadata/RwalkwDrift0.3.csv +0 -0
  29. {PythonTsa-1.4.7 → pythontsa-1.4.9}/src/PythonTsa/Ptsadata/SP500dailyreturns.csv +0 -0
  30. {PythonTsa-1.4.7 → pythontsa-1.4.9}/src/PythonTsa/Ptsadata/Southtemperature.txt +0 -0
  31. {PythonTsa-1.4.7 → pythontsa-1.4.9}/src/PythonTsa/Ptsadata/USEconomicChange.csv +0 -0
  32. {PythonTsa-1.4.7 → pythontsa-1.4.9}/src/PythonTsa/Ptsadata/USFemalesAged20+Job1948-81.csv +0 -0
  33. {PythonTsa-1.4.7 → pythontsa-1.4.9}/src/PythonTsa/Ptsadata/USQgdpunemp.csv +0 -0
  34. {PythonTsa-1.4.7 → pythontsa-1.4.9}/src/PythonTsa/Ptsadata/USbill.csv +0 -0
  35. {PythonTsa-1.4.7 → pythontsa-1.4.9}/src/PythonTsa/Ptsadata/USmacronInRate.txt +0 -0
  36. {PythonTsa-1.4.7 → pythontsa-1.4.9}/src/PythonTsa/Ptsadata/WTI-Brent.csv +0 -0
  37. {PythonTsa-1.4.7 → pythontsa-1.4.9}/src/PythonTsa/Ptsadata/Yearly mean total sunspot number 1700 - 2017.csv +0 -0
  38. {PythonTsa-1.4.7 → pythontsa-1.4.9}/src/PythonTsa/Ptsadata/areturns.csv +0 -0
  39. {PythonTsa-1.4.7 → pythontsa-1.4.9}/src/PythonTsa/Ptsadata/chaos.csv +0 -0
  40. {PythonTsa-1.4.7 → pythontsa-1.4.9}/src/PythonTsa/Ptsadata/dlGDPukcaus1q1980.csv +0 -0
  41. {PythonTsa-1.4.7 → pythontsa-1.4.9}/src/PythonTsa/Ptsadata/elec-temp.csv +0 -0
  42. {PythonTsa-1.4.7 → pythontsa-1.4.9}/src/PythonTsa/Ptsadata/gdpquarterlychina1992.1-2017.4.csv +0 -0
  43. {PythonTsa-1.4.7 → pythontsa-1.4.9}/src/PythonTsa/Ptsadata/h02July1991June2008.csv +0 -0
  44. {PythonTsa-1.4.7 → pythontsa-1.4.9}/src/PythonTsa/Ptsadata/ibmlogret.csv +0 -0
  45. {PythonTsa-1.4.7 → pythontsa-1.4.9}/src/PythonTsa/Ptsadata/milk.xlsx +0 -0
  46. {PythonTsa-1.4.7 → pythontsa-1.4.9}/src/PythonTsa/Ptsadata/monthly returns of PG stock 1961 to 2016.csv +0 -0
  47. {PythonTsa-1.4.7 → pythontsa-1.4.9}/src/PythonTsa/Ptsadata/monthly returns of Procter n Gamble stock n 3 market indexes 1961 to 2016.csv +0 -0
  48. {PythonTsa-1.4.7 → pythontsa-1.4.9}/src/PythonTsa/Ptsadata/nao.csv +0 -0
  49. {PythonTsa-1.4.7 → pythontsa-1.4.9}/src/PythonTsa/Ptsadata/realGdpConsInv.csv +0 -0
  50. {PythonTsa-1.4.7 → pythontsa-1.4.9}/src/PythonTsa/Ptsadata/us-q-rgdp.csv +0 -0
  51. {PythonTsa-1.4.7 → pythontsa-1.4.9}/src/PythonTsa/Ptsadata/usFOI.csv +0 -0
  52. {PythonTsa-1.4.7 → pythontsa-1.4.9}/src/PythonTsa/Ptsadata/usGDPnotAdjust.csv +0 -0
  53. {PythonTsa-1.4.7 → pythontsa-1.4.9}/src/PythonTsa/RandomWalk.py +0 -0
  54. {PythonTsa-1.4.7 → pythontsa-1.4.9}/src/PythonTsa/SeasonalRW.py +0 -0
  55. {PythonTsa-1.4.7 → pythontsa-1.4.9}/src/PythonTsa/Selecting_arma.py +0 -0
  56. {PythonTsa-1.4.7 → pythontsa-1.4.9}/src/PythonTsa/Selecting_arma2.py +0 -0
  57. {PythonTsa-1.4.7 → pythontsa-1.4.9}/src/PythonTsa/SimulSBM.py +0 -0
  58. {PythonTsa-1.4.7 → pythontsa-1.4.9}/src/PythonTsa/True_acf.py +0 -0
  59. {PythonTsa-1.4.7 → pythontsa-1.4.9}/src/PythonTsa/datadir.py +0 -0
  60. {PythonTsa-1.4.7 → pythontsa-1.4.9}/src/PythonTsa/plot_acf_pacf.py +0 -0
  61. {PythonTsa-1.4.7 → pythontsa-1.4.9}/src/PythonTsa/plot_multi_ACF.py +0 -0
  62. {PythonTsa-1.4.7 → pythontsa-1.4.9}/src/PythonTsa/plot_multi_Q_pvalue.py +0 -0
  63. {PythonTsa-1.4.7 → pythontsa-1.4.9}/src/PythonTsa.egg-info/dependency_links.txt +0 -0
  64. {PythonTsa-1.4.7 → pythontsa-1.4.9}/src/PythonTsa.egg-info/top_level.txt +0 -0
@@ -1,6 +1,6 @@
1
- Metadata-Version: 2.1
1
+ Metadata-Version: 2.4
2
2
  Name: PythonTsa
3
- Version: 1.4.7
3
+ Version: 1.4.9
4
4
  Summary: Package for Applied Time Series Analysis and Forecasting with Python, Springer 2022
5
5
  Author: Changquan Huang
6
6
  Author-email: h.changquan@icloud.com
@@ -9,6 +9,13 @@ Classifier: License :: OSI Approved :: MIT License
9
9
  Classifier: Operating System :: OS Independent
10
10
  Requires-Python: >=3.6
11
11
  Description-Content-Type: text/markdown
12
+ Dynamic: author
13
+ Dynamic: author-email
14
+ Dynamic: classifier
15
+ Dynamic: description
16
+ Dynamic: description-content-type
17
+ Dynamic: requires-python
18
+ Dynamic: summary
12
19
 
13
20
  This package is a companion to the book Applied Time Series Analysis and Forecasting with Python, Springer 2022. It contains several
14
21
  important Python functions for analyzing time series and most data sets analyzed in the book. Naturally, these functions can also be used to analyze other time series data.
@@ -5,7 +5,7 @@ with open("README.md", "r", encoding="utf-8") as fh:
5
5
 
6
6
  setuptools.setup(
7
7
  name="PythonTsa",
8
- version="1.4.7",
8
+ version="1.4.9",
9
9
  author="Changquan Huang",
10
10
  author_email="h.changquan@icloud.com",
11
11
  description="Package for Applied Time Series Analysis and Forecasting with Python, Springer 2022",
@@ -8,10 +8,10 @@ import numpy as np
8
8
  import pandas as pd
9
9
  import requests
10
10
 
11
- def create_evaluation_df(predictions, test_inputs, H, scaler):
11
+ def create_evaluation_df(predictions, test_inputs, h, scaler):
12
12
  """Create a data frame for easy evaluation"""
13
13
  eval_df = pd.DataFrame(
14
- predictions, columns=["t+" + str(t) for t in range(1, H + 1)]
14
+ predictions, columns=["t+" + str(t) for t in range(1, h + 1)]
15
15
  )
16
16
  eval_df["timestamp"] = test_inputs.dataframe.index
17
17
  eval_df = pd.melt(
@@ -24,7 +24,7 @@ def create_evaluation_df(predictions, test_inputs, H, scaler):
24
24
  return eval_df
25
25
 
26
26
 
27
- class TimeSeriesTensor(UserDict):
27
+ class tstensor(UserDict):
28
28
  """A dictionary of tensors for input into the RNN model.
29
29
 
30
30
  Use this class to:
@@ -47,7 +47,7 @@ class TimeSeriesTensor(UserDict):
47
47
  """
48
48
 
49
49
  def __init__(
50
- self, dataset, target, H, tensor_structure, freq="H", drop_incomplete=True
50
+ self, dataset, target, h, tensor_structure, freq="h", drop_incomplete=True
51
51
  ):
52
52
  self.dataset = dataset
53
53
  self.target = target
@@ -57,7 +57,7 @@ class TimeSeriesTensor(UserDict):
57
57
  self.dataframe = self._shift_data(H, freq, drop_incomplete)
58
58
  self.data = self._df2tensors(self.dataframe)
59
59
 
60
- def _shift_data(self, H, freq, drop_incomplete):
60
+ def _shift_data(self, h, freq, drop_incomplete):
61
61
 
62
62
  # Use the tensor_structures definitions to shift the features in the original dataset.
63
63
  # The result is a Pandas dataframe with multi-index columns in the hierarchy
@@ -68,7 +68,7 @@ class TimeSeriesTensor(UserDict):
68
68
  df = self.dataset.copy()
69
69
 
70
70
  idx_tuples = []
71
- for t in range(1, H + 1):
71
+ for t in range(1, h + 1):
72
72
  df["t+" + str(t)] = df[self.target].shift(t * -1, freq=freq)
73
73
  idx_tuples.append(("target", "y", "t+" + str(t)))
74
74
 
@@ -103,26 +103,27 @@ class TimeSeriesTensor(UserDict):
103
103
 
104
104
  return df
105
105
 
106
- def _df2tensors(self, dataframe):
106
+ def _df2tensors(self, dataframe):
107
107
 
108
- inputs = {}
109
- y = dataframe["target"]
110
- y = y.to_numpy()
111
- inputs["target"] = y
108
+ inputs = {}
109
+ y = dataframe["target"]
110
+ y = y.to_numpy()
111
+ inputs["target"] = y
112
112
 
113
- for name, structure in self.tensor_structure.items():
114
- rng = structure[0]
115
- cols = structure[1]
116
- tensor = dataframe[name][cols].to_numpy()
117
- if rng is None:
118
- tensor = tensor.reshape(tensor.shape[0], len(cols))
119
- else:
120
- tensor = tensor.reshape(tensor.shape[0], len(cols), len(rng))
121
- tensor = np.transpose(tensor, axes=[0, 2, 1])
122
- inputs[name] = tensor
113
+ for name, structure in self.tensor_structure.items():
114
+ rng = structure[0]
115
+ cols = structure[1]
116
+ tensor = dataframe[name][cols].to_numpy()
117
+ if rng is None:
118
+ tensor = tensor.reshape(tensor.shape[0], len(cols))
119
+ else:
120
+ tensor = tensor.reshape(tensor.shape[0], len(cols), len(rng))
121
+ tensor = np.transpose(tensor, axes=[0, 2, 1])
122
+ inputs[name] = tensor
123
123
 
124
- return inputs
124
+ return inputs
125
125
 
126
- def subset_data(self, new_dataframe):
126
+ def subset_data(self, new_dataframe):
127
127
 
128
- self.dataframe = new_dataframe
128
+ self.dataframe = new_dataframe
129
+ self.data = self._df2tensors(self.dataframe)
@@ -0,0 +1 @@
1
+ __version__ = "1.4.8"
@@ -1,6 +1,6 @@
1
- Metadata-Version: 2.1
1
+ Metadata-Version: 2.4
2
2
  Name: PythonTsa
3
- Version: 1.4.7
3
+ Version: 1.4.9
4
4
  Summary: Package for Applied Time Series Analysis and Forecasting with Python, Springer 2022
5
5
  Author: Changquan Huang
6
6
  Author-email: h.changquan@icloud.com
@@ -9,6 +9,13 @@ Classifier: License :: OSI Approved :: MIT License
9
9
  Classifier: Operating System :: OS Independent
10
10
  Requires-Python: >=3.6
11
11
  Description-Content-Type: text/markdown
12
+ Dynamic: author
13
+ Dynamic: author-email
14
+ Dynamic: classifier
15
+ Dynamic: description
16
+ Dynamic: description-content-type
17
+ Dynamic: requires-python
18
+ Dynamic: summary
12
19
 
13
20
  This package is a companion to the book Applied Time Series Analysis and Forecasting with Python, Springer 2022. It contains several
14
21
  important Python functions for analyzing time series and most data sets analyzed in the book. Naturally, these functions can also be used to analyze other time series data.
@@ -12,7 +12,7 @@ src/PythonTsa/Selecting_arma.py
12
12
  src/PythonTsa/Selecting_arma2.py
13
13
  src/PythonTsa/SimulSBM.py
14
14
  src/PythonTsa/True_acf.py
15
- src/PythonTsa/Utils.py
15
+ src/PythonTsa/TsTensor.py
16
16
  src/PythonTsa/__init__.py
17
17
  src/PythonTsa/datadir.py
18
18
  src/PythonTsa/plot_acf_pacf.py
@@ -1 +0,0 @@
1
- __version__ = "1.4.7"
File without changes
File without changes
File without changes