Skip to main content

Topsis Package

Project description

Topsis-Sehajbir_Singh_Mann-102003478

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.

Installation

pip install Sehajbir-Singh-Mann-102003478==1.1.2

Input File in CSV Format

Input file must contain Three or more columns
First column contains the Object Name / Variable Name
Columns from 2nd to last should have numeric values.

How to use it

Python File

which includes complete code for topsis calculation

Command Prompt

python <python_file> <Input Data File> <Weights> <Impacts> <Result File Name>

Example:

python 102003478.py 102003478-data.csv “1,1,1,1,1” “+,-,+,-,+” 102003478-result-1.csv
python 102003478.py 102003478-data.csv “2,2,3,3,4” “-,+,-,+,-” 102003478-result-2.csv



Note: The weights and impacts should be ',' seperated, input file should be in pwd.

Functions and Return Values

function = topsis_102003478()
return values = Creates a csv file with the topsis rank and performance score

Sample input data

Fund Name P1 P2 P3 P4 P5
M1 0.62 0.38 3.8 33.8 9.65
M2 0.75 0.56 5.7 50.3 14.33
M3 0.95 0.90 6.5 65.6 18.49
M4 0.61 0.37 6.2 43.6 12.70
M5 0.60 0.36 6.4 61.2 17.14
M6 0.76 0.58 5.3 68.0 18.66
M7 0.66 0.44 6.2 47.2 13.63
M8 0.80 0.64 5.7 37.1 11.06

Sample output data

Fund Name P1 P2 P3 P4 P5 Topsis Score Rank
M1 0.62 0.38 3.8 33.8 9.65 0.317272185 8
M2 0.75 0.56 5.7 50.3 14.33 0.452068871 4
M3 0.95 0.90 6.5 65.6 18.49 0.689037307 1
M4 0.61 0.37 6.2 43.6 12.70 0.340383903 7
M5 0.60 0.36 6.4 61.2 17.14 0.367206376 6
M6 0.76 0.58 5.3 68.0 18.66 0.481350901 3
M7 0.66 0.44 6.2 47.2 13.63 0.372999972 5
M8 0.80 0.64 5.7 37.1 11.06 0.51226635 2

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

Sehajbir_Singh_Mann_102003478-1.1.2.tar.gz (4.5 kB view details)

Uploaded Source

File details

Details for the file Sehajbir_Singh_Mann_102003478-1.1.2.tar.gz.

File metadata

File hashes

Hashes for Sehajbir_Singh_Mann_102003478-1.1.2.tar.gz
Algorithm Hash digest
SHA256 ea9dabddcda6d958291b4f32fa6f4898482e7f7c69eb97387f041e8de1281d6a
MD5 1ac5d518009453473e35c9ae911dcf2f
BLAKE2b-256 6225f4025793e139a53f41999a9089565d569a5e154fd5885ca0d0d2bd8cad67

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