Apply topsis to a dataset in a csv file
Project description
Apply TOPSIS to a dataset in csv format.
Usage:
For use in code:
from topsis import csvTopsis
From the command line:
csvTopsis (filename) (weights) (impacts) {options: delimiter(,)}
filename is the name of the csv file which has the dataset
The dataset must have a minimum of three columns and all the parameter columns must have numeric values. The first row is assumed to contain the column names and the first column is assumed to contain the row names
weights is a comma seperated list of weights ex: 1.0,1,1,1
weights must be numeric and the number of weights equal to number of parameter in the dataset
impacts is a comma seperated list of impacts ex: +,+,+,+
impacts must be either - or + and the number of impacts must be equal to number of parameters in the dataset
delimiter is the delimiter to be used to read the csv file
default ','
Sample output:
scores [0.5633920465033206, 0.3929781508166451, 0.8668523706767487, 0.14869542262467947, 0.5693097043728271]
ranks [3, 4, 1, 5, 2]
Functions:
csvTopsis.topsis(inputCSV, weights, impacts, delimiter = ',')
arguments:
inputCSV is a stream containing the dataset, it must have at least 3 columns and the parameter columns must have only numeric values. The first column is assumed to contain row names and the first row is assumed to contain column names
weights is a list with weights for the parameters in the dataset. The list must be numeric and have a size equal to the number of parameters in the dataset
impacts is a list with impacts for the parameters in the dataset. The list must have only '-' or '+' as values and the size must be equal to number of parameters in the dataset
delimiter is the delimiter to be used to read the inputCSV file object (default: ',')
returns:
resultCSV is a stream which contains the original dataset with 2 added columns namely 'Topsis Score' and 'Rank' the former contains the topsis score for the rows and the latter the topsis ranks
similarityList is a list containing the topsis scores of all the rows
rankList is a list containing the topsis ranks
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
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file TOPSIS-Vikram-101803368-1.0.2.tar.gz.
File metadata
- Download URL: TOPSIS-Vikram-101803368-1.0.2.tar.gz
- Upload date:
- Size: 3.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.2.0 pkginfo/1.6.1 requests/2.24.0 setuptools/40.8.0 requests-toolbelt/0.9.1 tqdm/4.50.2 CPython/3.7.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
aec1bced14b6c286fcdf68a5b3126a58b8935506d7cfec63584fa8fb0784682a
|
|
| MD5 |
87e140f565ce0541cab009fb9ba48007
|
|
| BLAKE2b-256 |
a890c0e846c111f1bcad56b7b8d86204da12dbc9dfa2cfe1adc58c14b371120f
|
File details
Details for the file TOPSIS_Vikram_101803368-1.0.2-py3-none-any.whl.
File metadata
- Download URL: TOPSIS_Vikram_101803368-1.0.2-py3-none-any.whl
- Upload date:
- Size: 4.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.2.0 pkginfo/1.6.1 requests/2.24.0 setuptools/40.8.0 requests-toolbelt/0.9.1 tqdm/4.50.2 CPython/3.7.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
f7727de4a04b641a1aec7b4e8dd92357f925a7362e45cef29510891c8ea30e26
|
|
| MD5 |
2d10b0b0b0bedbf8ce327d076d3aa336
|
|
| BLAKE2b-256 |
fb50e33468fc76cb7692ede73471d643e9b5857c0cbf757893cb043663fd3b0a
|