A Python package to calculate TOPSIS rankings
Project description
Topsis-Package
Topsis-Package is a Python library for implementing the TOPSIS (Technique for Order Preference by Similarity to Ideal Solution) method for multi-criteria decision analysis. It simplifies ranking and decision-making based on criteria weights and performance data.
Installation
Install the package directly from PyPI:
pip install topsis-package
Usage
Input
Prepare a CSV file with the following structure:
- The first row contains column headers (criteria names).
- The first column contains the names of alternatives (e.g., products or options).
- The remaining columns are numeric values representing the performance scores for each criterion.
Example Input CSV (data.csv):
Alternative, Criterion 1, Criterion 2, Criterion 3, Criterion 4
Option A, 250, 16, 12, 5
Option B, 200, 22, 8, 6
Option C, 300, 18, 15, 4
Option D, 275, 20, 14, 7
Running the Package
To execute, you will need:
- Path to the input CSV file.
- A comma-separated string of weights (e.g.,
"0.4,0.3,0.2,0.1"). - A comma-separated string of impacts (e.g.,
"+,+,-,-").
Example Code:
topsis input.csv "0.4,0.3,0.2,0.1" "+,+,-,-" result.csv
Input parameters
input_file = "data.csv" weights = "0.4,0.3,0.2,0.1" impacts = "+,+,-,-"
Output
The package will create a new CSV file with an additional column, "Topsis Score", and the final "Rank" for each alternative.
Example Output:
Alternative, Criterion 1, Criterion 2, Criterion 3, Criterion 4, Topsis Score, Rank
Option A, 250, 16, 12, 5, 0.78, 2
Option B, 200, 22, 8, 6, 0.56, 4
Option C, 300, 18, 15, 4, 0.84, 1
Option D, 275, 20, 14, 7, 0.64, 3
Features
- Simple Input Format: Provide your data in CSV format.
- Customizable Weights and Impacts: Define criteria importance and type (beneficial or non-beneficial).
- Automated Output: Generates scores and ranks for all alternatives.
Requirements
This package requires Python 3.7 or higher. Install any missing dependencies using pip.
Author
Developed by Teena Sapra.
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_teena_102217049-1.0.1.tar.gz.
File metadata
- Download URL: topsis_teena_102217049-1.0.1.tar.gz
- Upload date:
- Size: 3.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.0.1 CPython/3.10.5
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
ec11110ef1a597273ea3a9044b36839fb614b9f8f40b59bcca5b0c0930bc495d
|
|
| MD5 |
94f8bea3acf4eeca3f9428e6fe1c5731
|
|
| BLAKE2b-256 |
01ea03a1e9183506389f507c9e4b33149f558f39d69a381e44ab8bf9c15d6b50
|
File details
Details for the file topsis_teena_102217049-1.0.1-py3-none-any.whl.
File metadata
- Download URL: topsis_teena_102217049-1.0.1-py3-none-any.whl
- Upload date:
- Size: 4.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.0.1 CPython/3.10.5
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
100752c942ee972b73505a029e1c87269f4697f232aed20e8898bb2ece810cfc
|
|
| MD5 |
5f4c2c60840651f9bae6405b00afe5f3
|
|
| BLAKE2b-256 |
abf0a63eea5858d0bbbad06e624cfdfe0183dea46f52b15e8750a6809a21f83b
|