Observed since 20 Oct, 15:08 UTC
No superseded metadata states collected. Unchanged observations do not create new revisions.
A Python library for the TOPSIS decision-making method.
The TOPSIS (Technique for Order Preference by Similarity to Ideal Solution) library provides an implementation of the TOPSIS decision-making method. This technique is used to rank alternatives based on multiple criteria by comparing their distance from an ideal best and an ideal worst solution.
Install the library via pip:
pip install topsis-library
Here’s a quick guide to using the library:
from topsis.topsis import topsis
# Define the decision matrix
# Each row is an alternative, and each column is a criterion
data = [
[250, 16, 12, 5],
[200, 16, 8, 3],
[300, 32, 16, 4],
[275, 32, 8, 4],
[225, 16, 16, 2]
]
# Define weights for each criterion
weights = [0.25, 0.25, 0.25, 0.25]
# Define impacts for each criterion ('+' for benefit, '-' for cost)
impacts = ['+', '+', '-', '+']
# Calculate rankings and scores
rankings, scores = topsis(data, weights, impacts)
print("Rankings:", rankings)
print("Scores:", scores)
Rankings: [3, 1, 4, 2, 5]
Scores: [0.7722, 0.5634, 0.8523, 0.6472, 0.4321]
Run unit tests to ensure functionality:
python -m unittest discover tests
Raghav Manchanda
Download counts and popularity will appear here as the collector receives them.
| Version | Published | Direct dependencies | Open version |
|---|---|---|---|
| 0.2.0 | 17 Jan 2025 | 1 |
This describes our collected data; it is not a security assessment.
Shared repository data · GitHub
Observed since 20 Oct, 15:08 UTC
No superseded metadata states collected. Unchanged observations do not create new revisions.
package:e005f34eec399a5749e1c7778c0ce6ef9caf6e1b22e0696b186ca3696084ab7f