A Python package implementing TOPSIS technique.
Project description
TOPSIS implementation in Python
What is TOPSIS
Technique for Order Preference by Similarity to Ideal Solution (TOPSIS) originated in the 1980s as a multi-criteria decision making method. TOPSIS chooses the alternative of shortest Euclidean distance from the ideal solution, and greatest distance from the negative-ideal solution. More details at wikipedia.
Installation
Use the package manager pip to install this package.
pip install Topsis-Naman-101903304
How to use this package ?
In Terminal
$ topsis data.csv "1,1,1,1,2" "+,+,-,+,+" output.csv
In Python IDLE:
>>> import pandas as pd
>>> from topsis_python.topsis import topsis
>>> dataset = pd.read_csv('data.csv').values
>>> d = dataset[:,1:]
>>> w = [1,1,1,1]
>>> im = ["+" , "+" , "-" , "+" ]
>>> topsis(d,w,im)
Sample dataset
Fund Name | P1 | P2 | P3 | P4 | P5 |
---|---|---|---|---|---|
M1 | 0.92 | 0.71 | 4.5 | 43 | 12.59 |
M2 | 0.71 | 0.83 | 4.4 | 41.9 | 10.11 |
M3 | 0.77 | 0.62 | 3.5 | 33.2 | 13.2 |
M4 | 0.92 | 0.61 | 4.4 | 50.9 | 12.55 |
M5 | 0.7 | 0.88 | 6.7 | 43.7 | 16.91 |
M6 | 0.64 | 0.77 | 6.9 | 64.5 | 14.91 |
M7 | 0.68 | 0.44 | 4.5 | 31.1 | 13.83 |
M8 | 0.6 | 0.86 | 3 | 36.4 | 10.55 |
Output
Fund Name | P1 | P2 | P3 | P4 | P5 | Topsis Score | Rank |
---|---|---|---|---|---|---|---|
M1 | 0.92 | 0.71 | 4.5 | 43.0 | 12.59 | 0.606157764635227 | 6.0 |
M2 | 0.71 | 0.83 | 4.4 | 41.9 | 10.11 | 0.630939331184659 | 3.0 |
M3 | 0.77 | 0.62 | 3.5 | 33.2 | 13.23 | 0.6376673741860752 | 2.0 |
M4 | 0.92 | 0.61 | 4.4 | 50.9 | 12.55 | 0.44683746237145194 | 7.0 |
M5 | 0.7 | 0.88 | 6.7 | 43.7 | 16.91 | 0.6223296058794716 | 4.0 |
M6 | 0.64 | 0.77 | 6.9 | 64.5 | 14.91 | 0.36651530625461226 | 8.0 |
M7 | 0.68 | 0.44 | 4.5 | 31.1 | 13.83 | 0.6381151861152682 | 1.0 |
M8 | 0.6 | 0.86 | 3.0 | 36.4 | 10.55 | 0.6124418308455085 | 5.0 |
The output file contains columns of input file along with two additional columns having Topsis Score and Rank
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Close
Hashes for Topsis-Naman-101903304-1.0.0.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | b6aecf9b70dea3c2147c616162d0baedda6a4abf19c520b22492b5cccf05853e |
|
MD5 | 69504d2940397ff9d533d1a037807fb6 |
|
BLAKE2b-256 | 48f8fb3f2226325808a6deaf8df1f4ed67a803661da80ab45f4cdca5fafec783 |
Close
Hashes for Topsis_Naman_101903304-1.0.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 85088051ca70dd8c1a1b5d6b8bdefdf0d7ed4b49d8733a310a2c31d729d18b60 |
|
MD5 | 1b717e39d0b02e394e9ea1c3836a4248 |
|
BLAKE2b-256 | 22a8fcf41d6a9aa6e327d4acc2fb0c3e0ddb87a3bdd2157a8ac5a0b1a1e068cf |