Skip to content
Related Articles

Related Articles

Spikes package in Python

View Discussion
Improve Article
Save Article
  • Last Updated : 12 Nov, 2020
View Discussion
Improve Article
Save Article

spikes is a package in Python, a command-line utility used for displaying bar graphs on the terminal, therefore can be used for quick analysis

Installation: Run the following pip command on the terminal:

pip install spikes

It’s recommend to run all program on terminal of IDE as PowerShell doesn’t support few output characters 

Syntax: spike [space separated data]

Example 1: To obtain a simple bar graph of whole numbers on the terminal

spike 10 20 30 40 50 60

Output:

Example 2: Data can be also decimal numbers.

spike 0 1 2 0.3 0.4 0.5 6

Output:

Example 3: If data is negative, (compulsory to have 1st value as positive value), they will be considered as zero and the positive values of graph will be shown

spike 2 -7 -9
spike -2 -7 9

Output:

Example 4: For vertical data use -1 flag at the beginning.

spike -1 5 10 17 29

Output:

My Personal Notes arrow_drop_up
Recommended Articles
Page :

Start Your Coding Journey Now!