Skip to main content

Converting time-series to graph using three different method which are natural visibility graph, horizontal visibility graph, and quantile graph

Project description

ts2g (time series to graph)

This a package for converting timeseries to graph using tree different method which are natural visibility graph, horizontal visibility graph and quantile graph this three methods are come from the following articels:

Bezsudnov, I. and Snarskii, A., 2014. From the time series to the complex networks: The parametric natural visibility graph. Physica A: Statistical Mechanics and its Applications, 414, pp.53-60.

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:

  1. install python > 3.6 how to install?
  2. install pip how to install?
  3. 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)

  1. and then enter this command
pip install openpyxl && pip install t2sg

and hit enter! done.

How to import:

from t2sg import read, calculate, save

How to use:

#import your data! data should be .csv or .xlsx file 
#for example:
data = read.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 = calculate.vg(data) # this function will return a matrix of results

#for horisantal visibility graph, example:
result = calculate.hg(data) # this function will return a matrix of results

#for quantile graph, example:
q = 10
result = calculate.qg(data, q) # this function will return a matrix of results


#then save result!

save.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:

  1. name_A_vg.txt
  2. name_graph_indicator_vg.txt
  3. name_node_labels_vg.txt

if result is for hg, saved files will be:

  1. name_A_hg.txt
  2. name_graph_indicator_hg.txt
  3. name_node_labels_hg.txt

if result is for qg, saved files will be:

  1. name_A_qg_q=10.txt
  2. name_graph_indicator_qg_q=10.txt
  3. name_node_labels_qg_q=10.txt
  4. name_edge_labels_qg_q=10.txt

note:

We strongly suggest using .csv, don't use .xlsx for big files!

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

ts2g-0.0.1.tar.gz (5.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

ts2g-0.0.1-py3-none-any.whl (5.9 kB view details)

Uploaded Python 3

File details

Details for the file ts2g-0.0.1.tar.gz.

File metadata

  • Download URL: ts2g-0.0.1.tar.gz
  • Upload date:
  • Size: 5.1 kB
  • Tags: Source
  • Uploaded using 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

File hashes

Hashes for ts2g-0.0.1.tar.gz
Algorithm Hash digest
SHA256 96319ee4fb81797fe91f131ddb52d67882a879753c88b1bada480ee1e3c553d3
MD5 9a8b09c63d1a68b5e1ba85a5aca5f492
BLAKE2b-256 8e174f49e4b3af87e3766a2f0094be2124120c0024401d73bffa71ffd6f20769

See more details on using hashes here.

File details

Details for the file ts2g-0.0.1-py3-none-any.whl.

File metadata

  • Download URL: ts2g-0.0.1-py3-none-any.whl
  • Upload date:
  • Size: 5.9 kB
  • Tags: Python 3
  • Uploaded using 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

File hashes

Hashes for ts2g-0.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 f3335a6a2208233caab9252ebdd7b414ec0d42453bdfcb15fb7978dd17c43247
MD5 406f85a74f671d9633d3801556da7acc
BLAKE2b-256 8746568a298b1feadc755f90df2acac7e9e2b4dcc3378a9d2c0b833da4d288a8

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page