A Python package to perform TOPSIS analysis on datasets.
Project description
TOPSIS Implementation in Python
Overview
This Python script provides an implementation of the TOPSIS (Technique for Order of Preference by Similarity to Ideal Solution) method, a widely used technique for multi-criteria decision-making. It calculates performance scores and ranks for a dataset based on specified weights and impacts.
How to Use
Execute the script using the following command:
python topsis.py <inputFileName> <weights> <impacts> <resultFileName>
<inputFileName>: Path to the CSV file containing the dataset.<weights>: Comma-separated list of weights for the criteria (e.g.,1,2,3).<impacts>: Comma-separated list of impacts for the criteria (+for benefit,-for cost).<resultFileName>: Name of the output file where the results will be saved.
Input File Guidelines
- The input file must be a
.csvformat with a minimum of 3 columns. - The first column can contain non-numeric values (e.g., identifiers).
- All columns from the second onward must contain numeric values.
Key Features
- Validation:
- Ensures the correct number of command-line arguments.
- Validates weights, impacts, and the consistency of column counts.
- Handles missing or invalid input files.
- Error Handling:
- Provides clear error messages for issues such as missing files, non-numeric data, or mismatched parameters.
- Output Generation:
- Adds two columns to the dataset:
Topsis ScoreandRank. - Saves the processed results to the specified output file.
- Adds two columns to the dataset:
Prerequisites
- Python 3.x
- Required libraries:
pandas,math,sys
Install dependencies using the command:
pip install pandas
License
This project is open-source and available under the MIT License.
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_sachet_102203345-1.0.0.tar.gz.
File metadata
- Download URL: topsis_sachet_102203345-1.0.0.tar.gz
- Upload date:
- Size: 4.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.0.1 CPython/3.13.1
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
bf2858ebc8e2f0b053da849a9a592942956708a5252d728b3699b52543820b05
|
|
| MD5 |
b08271b120b1c89b9eb962b46f58141e
|
|
| BLAKE2b-256 |
e5c42c6d57ffbf9bde22b3b1b6aa03ccf4b0ad0cff484d110bbb1c90b660e004
|
File details
Details for the file topsis_sachet_102203345-1.0.0-py3-none-any.whl.
File metadata
- Download URL: topsis_sachet_102203345-1.0.0-py3-none-any.whl
- Upload date:
- Size: 5.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.0.1 CPython/3.13.1
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
609156417111f4f46cde905783a267abc5a44a22d3afa210e60fead557dec651
|
|
| MD5 |
fd0cad334af830ee7e79347908f1b66c
|
|
| BLAKE2b-256 |
44912cc649dd706f61447297ae3cefdd2b4c9ad72e2e9feed237f446a1fc7ef6
|