A Python package for implementing the TOPSIS method.
Project description
TOPSIS Implementation in Python
Overview This Python script implements TOPSIS (Technique for Order of Preference by Similarity to Ideal Solution), a multi-criteria decision-making method to rank alternatives based on criteria weights and impacts.
Requirements
- Python 3.x
- Libraries: Install via
pip install pandas numpy
Files
102217055.py: Main Python script.- Input File: CSV containing alternatives and criteria.
- Output File: CSV with calculated scores and ranks.
Input Format
- First Column: Alternative names (e.g., A, B, C).
- Other Columns: Numerical criteria values.
Example (data.csv): Alternatives,Criterion1,Criterion2,Criterion3 A,20,300,50 B,25,250,60 C,30,200,70
Usage Run the script with: python 102217055.py
Arguments:
- : Path to input CSV.
- : Comma-separated weights (e.g., 1,1,1).
- : Comma-separated impacts (+ for beneficial, - for non-beneficial).
- : Path to save output CSV.
Example: python 102217055.py data.csv "1,1,1" "+,+,-" result.csv
Output Format The output CSV includes the input data with:
- Topsis Score: Calculated score for each alternative.
- Rank: Based on TOPSIS score.
Example (result.csv): Alternatives,Criterion1,Criterion2,Criterion3,Topsis Score,Rank A,20,300,50,0.78,2 B,25,250,60,0.85,1 C,30,200,70,0.63,3
Error Handling
- File Errors: Ensure the input file exists and is correctly formatted.
- Mismatch in Weights/Impacts: Ensure their count matches the criteria columns.
- Invalid Impacts: Use only + or -.
Method Overview
- Normalize: Scale values for comparability.
- Weighting: Apply weights to normalized values.
- Ideal Values: Determine best and worst values for criteria.
- Distance Calculation: Measure distances from ideal best/worst.
- Score & Rank: Compute scores and rank alternatives.
This script simplifies multi-criteria decision-making. Reach out for support if needed!
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_angad_singh_marwaha_102217055-0.1.0.tar.gz.
File metadata
- Download URL: topsis_angad_singh_marwaha_102217055-0.1.0.tar.gz
- Upload date:
- Size: 4.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.0.1 CPython/3.11.5
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d5cd99a516eae9b6416775ae579f0dfb4a25f859e6642f1930f64091e240d4e3
|
|
| MD5 |
3ff0ea8b358b5072951dea9f4f0f7b70
|
|
| BLAKE2b-256 |
4705aa201060eba422d45651931ddbb70686b5eac1b8f62c8174d9f7afddb57c
|
File details
Details for the file Topsis_Angad_Singh_Marwaha_102217055-0.1.0-py3-none-any.whl.
File metadata
- Download URL: Topsis_Angad_Singh_Marwaha_102217055-0.1.0-py3-none-any.whl
- Upload date:
- Size: 4.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.0.1 CPython/3.11.5
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
1756b30b0025cc6cdd42879b9ac0aa8a477ae88eb525d7b336d62ad5c645cd95
|
|
| MD5 |
92d8997bff5494b453ea27329d84056c
|
|
| BLAKE2b-256 |
088cb5d43b296786feb3065b90beb694146a97963b5ada0b2253a2384cb1aba3
|