Implementation of TOPSIS for multi-criteria decision making
Project description
Topsis-Rohit-102203804
A Python package implementing the TOPSIS (Technique for Order of Preference by Similarity to Ideal Solution) method for multi-criteria decision making. This package helps compute rankings for alternatives based on their proximity to ideal best and worst solutions.
Installation
Install the package using pip:
pip install Topsis-Rohit-102203804
Install required dependencies:
pip install pandas numpy pyexcel
Features
- Compute TOPSIS scores and rankings for alternatives
- Support for custom weights and impacts for decision criteria
- Export results to CSV file
- Comprehensive input validation
- Both command-line and programmatic usage
- Support for CSV and Excel input files
Usage
Command Line Interface
topsis <InputDataFile> <Weights> <Impacts> <ResultFileName>
Parameters:
InputDataFile: Path to input dataset (CSV/XLSX)Weights: Comma-separated criterion weights (e.g., "1,2,3")Impacts: Comma-separated criterion impacts ('+' for maximize, '-' for minimize)ResultFileName: Output file path for results
Example:
topsis data.csv "1,1,1,1,1" "+,+,-,+,-" result.csv
Python Package Usage
from topsis_rohit_102203804.topsis import topsis
# Perform TOPSIS analysis
topsis("input.csv", [1,1,1,1,1], ['+','+','-','+','-'], "output.csv")
Input Data Format
File Requirements
- Must contain at least 3 columns
- First column: Names of alternatives
- Columns 2 onwards: Numeric values for criteria
Example Input CSV:
Alternative,Criterion1,Criterion2,Criterion3
A1,250,16,12
A2,200,18,11
A3,180,20,10
Output Format
The package generates a CSV file with the original data plus two additional columns:
- Topsis Score: Calculated similarity to ideal solution
- Rank: Final ranking of alternatives
Error Handling
The package validates:
- Number of command-line arguments
- File existence and readability
- Minimum column requirement (3 or more)
- Numeric values in criteria columns
- Matching counts of weights, impacts, and criteria
- Valid impact symbols (+ or -)
- Proper formatting of weights and impacts (comma-separated)
Prerequisites
- Python 3.6 or higher
- Dependencies:
- pandas
- numpy
- pyexcel
License
MIT License
Author
Rohit (GitHub Profile)
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_rohit_102203804-1.2.0.tar.gz.
File metadata
- Download URL: topsis_rohit_102203804-1.2.0.tar.gz
- Upload date:
- Size: 4.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.0.1 CPython/3.12.1
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
772f5f606a49f004fe60e644fe2a75fc5c626b5fcad9632d82aff020b1881f1d
|
|
| MD5 |
d807b8573d3907abcea67f250eb581aa
|
|
| BLAKE2b-256 |
6433bd2adb0dabec54cc94baa33a6ee64063331d70ebc84b200b4dfc37f4849c
|
File details
Details for the file Topsis_Rohit_102203804-1.2.0-py3-none-any.whl.
File metadata
- Download URL: Topsis_Rohit_102203804-1.2.0-py3-none-any.whl
- Upload date:
- Size: 5.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.0.1 CPython/3.12.1
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
8868e967201a274d977f2c0cbe1bb21527fabfbeb4212ffc2128a453b1f65307
|
|
| MD5 |
44821a145fd0b997998fdef3c96b93af
|
|
| BLAKE2b-256 |
4c153e5c2573ece0b5723300cf43498b31424d6f589a3388c290b5d6f13080bd
|