ts2g (time series to graph)
This a package for converting timeseries to graph using three different method which are natural visibility graph, horizontal visibility graph and quantile graph this three methods are come from the following articels:
Lacasa, Lucas, Bartolo Luque, Fernando Ballesteros, Jordi Luque, and Juan Carlos Nuño. 2008. “From Time Series to Complex Networks: The Visibility Graph.” Proceedings of the National Academy of Sciences of the United States of America 105 (13): 4972–75.
Luque, B., Lacasa, L., Ballesteros, F. and Luque, J., 2009. Horizontal visibility graphs: Exact results for random time series. Physical Review E, 80(4).
Campanharo, A., Sirer, M., Malmgren, R., Ramos, F. and Amaral, L., 2011. Duality between Time Series and Networks. PLoS ONE, 6(8), p.e23378.
Dependencies:
openpyxl
How to install package:
- install python > 3.6 how to install?
- install pip how to install?
- open terminal (linux or mac) or command prompt (windows):
to open terminal if you are using mac: 1. Press Command + Space Bar on your Mac Keyboard. 2. Type in “Terminal” 3. When you see Terminal in the Spotlight search list, click it to open the app.
to open command prompt if you are using windows: 1. right-click the Windows icon in the bottom-left corner of your screen. 2. click on powershell(admin) or command prompt(admin)
- and then enter this command
pip install openpyxl && pip install ts2g
and hit enter! done.
How to import:
import ts2g
How to use:
#import your data! data should be .csv or .xlsx file
#for example:
data = ts2g.importData("data.csv") # this function will return a matrix of data
#replace you data file with data.csv
#then calculate the data:
#for vertical visibility graph, example:
result = ts2g.vg(data) # this function will return a matrix of results
#for horisantal visibility graph, example:
result = ts2g.hg(data) # this function will return a matrix of results
#for quantile graph, example:
q = 10
result = ts2g.qg(data, q) # this function will return a matrix of results
#then save result!
ts2g.save(result, "name") #this funtion will save results in .txt files!
How saved files are look like:
if result is for vg, saved files will be:
- name_A_vg.txt
- name_graph_indicator_vg.txt
- name_node_labels_vg.txt
if result is for hg, saved files will be:
- name_A_hg.txt
- name_graph_indicator_hg.txt
- name_node_labels_hg.txt
if result is for qg, saved files will be:
- name_A_qg_q=10.txt
- name_graph_indicator_qg_q=10.txt
- name_node_labels_qg_q=10.txt
- name_edge_labels_qg_q=10.txt
note:
We strongly suggest using .csv, don't use .xlsx for big files!
Metadata
Release files for ts2g 0.0.3
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 |
|---|---|---|---|---|
| ts2g-0.0.3.tar.gz | 5.1 kB | Without provenance | Details for ts2g-0.0.3.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| ts2g-0.0.3-py3-none-any.whl | Python 3 | none | any | Details for ts2g-0.0.3-py3-none-any.whl |
Total release size: 11.2 kB
Release files / ts2g-0.0.3.tar.gz
| Download URL | ts2g-0.0.3.tar.gz |
|---|---|
| Size | 5.1 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
40a8008df6b8de9c06461a6fed93c0ae08b83333a7d7caa6a191448a08b9df97
|
|
BLAKE2b-256 checksum How to use checksums |
4a80d47db05edc7e1782ddddccb7a1e006b10d62f974e7f2cd9e14e349741609
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.4.2 importlib_metadata/4.6.4 pkginfo/1.7.1 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.36.1 CPython/3.7.4
|
Release files / ts2g-0.0.3-py3-none-any.whl
| Download URL | ts2g-0.0.3-py3-none-any.whl |
|---|---|
| Size | 6.0 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
125e1dbc71fb36f70ab334ced551756d80b126e24b443a54c7f86209769d0963
|
|
BLAKE2b-256 checksum How to use checksums |
af55ebc903dc6be8ce85d46bf4d082fe527038c41edc48bdb2bf8a22e1554f1d
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.4.2 importlib_metadata/4.6.4 pkginfo/1.7.1 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.36.1 CPython/3.7.4
|
Security for ts2g 0.0.3
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.