pyinnovativetrend
Trend analysis is a statistical technique used to examine data over time to identify patterns, trends, or movements in a particular direction. It is widely used in various fields such as finance, economics, marketing, environmental science, and many others. A very common and conventional method to detect trend is mann-kendall trend test proposed by Mann and Kendall. However, an innovative method, proposed by Sen (2012), is widely used now-a-days due to its simplicity and graphical features. This innovative trend analysis method is very sensitive and can detect trends that are overlooked by conventional methods like MK test.
Installation
The package is installed using pip:
pip install pyinnovativetrend
Function details:
pyinnovativetrend.ITA_single
pyinnovativetrend.ITA_single( x, length, alpha = 0.05, graph={}, showgraph = True)
This function calculates trend and other necessary parameters for single list or numpy array and returns a named tuple. By default, a graph is illustrated and saved on the local machine.
Example:
import pyinnovativetrend as pit
x = [1,2,3,4,5,6,2,3,5,2,3,4,4]
graph ={
'xlabel' : 'First sub-series (1980 - 1985)',
'ylabel' : 'Second sub-series (1986 - 1991)',
'title' : 'Time series analysis',
'dpi' : 450,
'fontsize' : 10
}
pit.ITA_single(x, 12, graph = graph)
Output: ITA(trend='No trend', h=False, p=0.2049477839420626, z=-1.2675805428826508, slope=-0.027777777777777752, standard_deviation=1.2555432644432805, slope_standard_deviation=0.021914014011770254, correlation=0.9341987329938274, lower_critical_level=-0.0429506782197758, uper_critical_level=0.0429506782197758)
pyinnovativetrend.ITA_multiple_by_station
ITA_multiple_by_station(length, filename=[], column=[], exceptcolumn=[],graph={}, alpha =0.05, rnd=2, csv = False, directory_path = "./", output=[], out_direc="./")
This function calculates trend and other necessary parameters for multiple stations. The data is retrieved from excel or csv files from a desired or root directory and results are saved as excel format sorted by stations on desired or root directory. By default, multiple graphs sorted by stations are illustrated and saved on the local machine on desired directory or root directory.
Example:
import pyinnovativetrend as pit
graph ={
'xlabel' : 'First sub-series (1980 - 1985)',
'ylabel' : 'Second sub-series (1986 - 1991)',
'title' : 'Time series analysis',
'dpi' : 450,
'fontsize' : 10
}
pit.ITA_multiple_by_station(38, exceptcolumn=['Year'], graph = graph)
Output:
Excel files sample
Figure Sample
pyinnovativetrend.ITA_multiple_by_column
pyinnovativetrend.ITA_multiple_by_station (length, filename=[], column=[], exceptcolumn=[],graph={}, alpha =0.05, rnd=2, csv = False, directory_path = "./", output=[], out_direc="./")
This function calculates trend and other necessary parameters for multiple stations. The data is retrieved from excel or csv files from a desired or root directory and results are saved as excel format sorted by columns on desired or root directory. By default, multiple graphs sorted by columns are illustrated and saved on the local machine on desired directory or root directory.
Example:
import pyinnovativetrend as pit
graph ={
'xlabel' : 'First sub-series (1980 - 1985)',
'ylabel' : 'Second sub-series (1986 - 1991)',
'title' : 'Time series analysis',
'dpi' : 450,
'fontsize' : 10
}
pit.ITA_multiple_by_column(38, exceptcolumn=['Year'], graph = graph)
Output:
Excel files sample
Figure Sample
pyinnovativetrend.ITA_single_vis(x,length,graph={})
pyinnovativetrend.ITA_single_vis(x,length,figsize=(10,10),graph={})
This function illustrates a graph and saves on the local machine.\
Example:
import pyinnovativetrend as pit
x = [1,2,3,4,5,6,2,3,5,2,3,4,4]
graph ={
'xlabel' : 'First sub-series (1980 - 1985)',
'ylabel' : 'Second sub-series (1986 - 1991)',
'title' : 'Time series analysis',
'dpi' : 450,
'fontsize' : 10
}
pit.ITA_single_vis(x, 12, graph = graph)
Output:
pyinnovativetrend.ITA_multiple_vis_by_station
pyinnovativetrend.ITA_multiple_vis_by_station(length, graph={}, filename=[], column=[], exceptcolumn=[], csv = False, directory_path = "./")
This function illustrates multiple graphs sorted by stations and saves on the local machine on desired directory or root directory. The data is retrieved from excel or csv files from a desired or root directory and results are saved as excel format sorted by stations on desired or root directory.
Example:
import pyinnovativetrend as pit
graph ={
'xlabel' : 'First sub-series (1980 - 1985)',
'ylabel' : 'Second sub-series (1986 - 1991)',
'title' : 'Time series analysis',
'dpi' : 450,
'fontsize' : 10
}
pit.ITA_multiple_vis_by_stations(38, exceptcolumn=['Year'], graph = graph)
Output:
pyinnovativetrend.ITA_multiple_vis_by_column
pyinnovativetrend.ITA_multiple_vis_by_column(length, graph={}, filename=[], column=[], exceptcolumn=[], csv = False, directory_path = "./")
This function illustrates multiple graphs sorted by stations and saves on the local machine on desired directory or root directory. The data is retrieved from excel or csv files from a desired or root directory and results are saved as excel format sorted by columns on desired or root directory.
Example:
import pyinnovativetrend as pit
graph ={
'xlabel' : 'First sub-series (1980 - 1985)',
'ylabel' : 'Second sub-series (1986 - 1991)',
'title' : 'Time series analysis',
'dpi' : 450,
'fontsize' : 10
}
pit.ITA_multiple_vis_by_stations(38, exceptcolumn=['Year'], graph = graph)
Output:
Parameters:
x : List or numpy array
The time series or data series whose trend is to be determined
length : integer
Length of the time series. If given length of the time series is odd, the earliest/first entry will be ommitted.
filename : List default all excel/csv files
List of files or stations which contain the data sorted by month/year/season.
column : List default all columns
List of columns or data-series which contain the data.
exceptcolumn : List default empty list
List of columns for which analysis is not required (For example, column of year).
csv : bool default False The type of files. By default the file type is excel. However, if the files are in csv format, csv should be assigned to True.
directory_path : string default root
Directory path of the files where the files are stored.
output : list default station names or column names
Name of the files by which the results will be saved.
out_direc : string default root
Directory path of the files where the results will be saved.
alpha : float default 0.05
Level of significance in a two-tailed test.
showgraph : bool default True
Choose if graph is to be illustrated along with calculation in single analysis.
graph : python dictionary (optional)
Default values
'trendLineStyle' : 'dashed' # Line style of trend line, for more line style type visit documentation of matplotlib
'scatterMarker' : '.' # Marker type of scattered data points, for more marker visit documentation of matplotlib
'title' : '' # Title of the graph or illustration
'xlabel' : 'First sub-series' # Label of X-axis
'ylabel' : 'Second sub-series' # Label of Y-axis
'noTrendLineStyle' : 'solid' # Line style of no trend line or 1:1 line, for more line style type visit documentation of matplotlib
'output_dir' : './' # Directory of output file where graph is to be saved
'output_name' : 'outputfig.png' # Name of the graph or illustration
'dpi' : 300 # Dot per inch (dpi) of the graph or illustration
'row' : - # Row number of the subplots. If not provided, will be calculated automatically. (Available only for multiple analysis)
'colm': - # column number of the subplots. If not provided, will be calculated automatically. (Available only for multiple analysis)\
Output:
trend:
Tells if trend exists and type of trend
h:
True (if trend is present) and False (if trend is absent)
p:
p-value for the significant test (2-tailed test)
z:
Normalized test statistics (2-tailed test)
slope:
Slope of the trend
standard_deviation:
standard deviation of the data series
slope_standard_deviation:
Standard deviation of slope
correlation:
Correlation between the sorted sub-series
lower_critical_level:
Lower critical value for 2-tailed test
upper_critical_level:
Upper critical value for 2-tailed test
Metadata
Release files for pyinnovativetrend 1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| pyinnovativetrend-1.0.tar.gz | 10.4 kB | Without provenance | Details for pyinnovativetrend-1.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| pyinnovativetrend-1.0-py3-none-any.whl | Python 3 | none | any | Details for pyinnovativetrend-1.0-py3-none-any.whl |
Total release size: 20.1 kB
Release files / pyinnovativetrend-1.0.tar.gz
| Download URL | pyinnovativetrend-1.0.tar.gz |
|---|---|
| Size | 10.4 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
a4086946d6fe5730aecfd88252af8f6f9559dc60ac094f27c9667579d000de58
|
|
BLAKE2b-256 checksum How to use checksums |
854246668033b74053cc8d3bd932e0ff3c8c986641ae787064a5d1b7c042d533
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/5.1.1 CPython/3.12.3
|
Release files / pyinnovativetrend-1.0-py3-none-any.whl
| Download URL | pyinnovativetrend-1.0-py3-none-any.whl |
|---|---|
| Size | 9.7 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
93e03c2c64b2e16b829d773b1a47e42bc0101d2c46715aece989e37411e24ae5
|
|
BLAKE2b-256 checksum How to use checksums |
b618e011e87ecd52d6411a1e7f3c9db712bb35204f8f9b5196f51450195ece99
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/5.1.1 CPython/3.12.3
|
Security for pyinnovativetrend 1.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.