Skip to main content

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 column names and the first row is assumed to contain row 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


Download files

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

Source Distribution

TOPSIS-Vikram-101803368-1.0.1.tar.gz (3.4 kB view details)

Uploaded Source

Built Distribution

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

TOPSIS_Vikram_101803368-1.0.1-py3-none-any.whl (4.2 kB view details)

Uploaded Python 3

File details

Details for the file TOPSIS-Vikram-101803368-1.0.1.tar.gz.

File metadata

  • Download URL: TOPSIS-Vikram-101803368-1.0.1.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

Hashes for TOPSIS-Vikram-101803368-1.0.1.tar.gz
Algorithm Hash digest
SHA256 7e494afb8d7ef01db833cefb08470cb553a1285300fb167f4a38a8eb629d2f6f
MD5 bb9be31ab48e4e5b7ebbe2413d2bfa1d
BLAKE2b-256 81bcaeaf0b130c210fff91fee1f393d60917cb83ecc876f5e200a5c0e1c6e3be

See more details on using hashes here.

File details

Details for the file TOPSIS_Vikram_101803368-1.0.1-py3-none-any.whl.

File metadata

  • Download URL: TOPSIS_Vikram_101803368-1.0.1-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

Hashes for TOPSIS_Vikram_101803368-1.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 0d45a45444a8c7afc1f31b3de13d7b37ac6197657326711251f149fe1c754702
MD5 cd7e5eec6d7393d22670fec1f7261c40
BLAKE2b-256 13a75107c497394898a1192b4d8db29e88e09dee5819fd914715260266b0a60c

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