Skip to main content

TOPSIS for MCDM(Multiple Criteria Decision Making)

Project description

Library used to calculate topsis score

TOPSIS is used for multiple Criteria Decision Making (MCDM)

TOPSIS is based on the fundamental premise that the best solution has the shortest distance from the positive-ideal solution, and the longest distance from the negative-ideal one. Alternatives are ranked with the use of an overall index calculated based on the distances from the ideal solutions.


normalize function takes a dataframe as argument .

It normalizes columns 2nd to the last column of the dataframe.

All the values from the 2nd column to the last column should be numeric.

Outputs a dataframe.


weightAssignment takes a dataframe(output of normalize function) and a numeric list as inputs.

weightAssignment function assigns weights to different columns .

Outputs a dataframe.


ideal function takes a dataframe(output of weightAssignment function) and a list of string having elements either ‘+’ or ‘-‘.

Used to calculate max and minimum value of each column.

Outputs a pair of numeric lists.


euclideanDist function takes a dataframe(output of weightAssignment function) and 2 numeric lists(output of ideal function).

Calculates the euclidean distance of each row of dataframe with the 2 numeric lists.

Outputs a pair of numeric lists.


performance_score takes 2 numeric lists (output of euclideanDist function) as inputs.

Calculates topsis score of each row.

Outputs a numeric list.


TOPSIS_result takes a dataframe(output of weightAssignment function or Orignal dataframe) and a numeric list(output of performance_score function) as inputs.

assigns a rank to the list.

The ranks and the list are appended to the dataframe.

Outputs a dataframe.

Change Log

0.0.1 (21/01/2023)

  • First Release

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_Shubham_102067011-0.0.4.tar.gz (3.6 kB view details)

Uploaded Source

File details

Details for the file Topsis_Shubham_102067011-0.0.4.tar.gz.

File metadata

File hashes

Hashes for Topsis_Shubham_102067011-0.0.4.tar.gz
Algorithm Hash digest
SHA256 3ac3db531ff5182d492049ea02c5bd8e599d1ec8aca3bdfbd451231a7abcf8d1
MD5 301c1a7d1c6bcccb16bf56521ab26ea6
BLAKE2b-256 bee3d008dcb418c9c911c4755e42faf3fa570a1d6306b68f72ea1e7bd869c7e0

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