A Python package to perform TOPSIS analysis.
Project description
# TOPSIS-Sidharth-102218069
## Overview
This package implements the TOPSIS (Technique for Order of Preference by Similarity to Ideal Solution) method for multi-criteria decision-making. The method ranks alternatives based on their relative closeness to the ideal solution.
## Installation
To install the package, navigate to the root directory of the project (where `setup.py` is located) and run the following command:
```bash
pip install .
This will install the package locally.
Usage
You can use this package from the command line to calculate TOPSIS scores and rankings for a given dataset.
Command Line
topsis <InputDataFile> <Weights> <Impacts> <ResultFileName>
Example
topsis 102218069-data.csv "1,1,1,2" "+,+,-,+" 102218069-result.csv
Parameters
<InputDataFile>
: Path to the input CSV file containing the data.<Weights>
: Comma-separated weights for each criterion.<Impacts>
: Comma-separated impacts for each criterion, where each impact is either+
(beneficial) or-
(non-beneficial).<ResultFileName>
: The name of the output CSV file where the results will be saved.
Sample Input File Format
The input CSV file should have the following structure:
Fund Name | P1 | P2 | P3 | P4 | P5 |
---|---|---|---|---|---|
M1 | 0.84 | 0.71 | 6.7 | 42.1 | 12.59 |
M2 | 0.91 | 0.83 | 7.0 | 31.7 | 10.11 |
... | ... | ... | ... | ... | ... |
Sample Output File Format
The output CSV file will have the following structure:
Fund Name | P1 | P2 | P3 | P4 | P5 | Topsis Score | Rank |
---|---|---|---|---|---|---|---|
M1 | 0.84 | 0.71 | 6.7 | 42.1 | 12.59 | 0.3653 | 6 |
M2 | 0.91 | 0.83 | 7.0 | 31.7 | 10.11 | 0.2819 | 8 |
... | ... | ... | ... | ... | ... | ... | ... |
Error Handling
The program will raise an error and terminate if:
- The input file is not found.
- The number of weights and impacts does not match the number of criteria.
- Impacts contain values other than
+
or-
. - Weights are not numeric.
Dependencies
pandas
numpy
These dependencies are automatically installed when you install the package.
Author
Sidharth Dhawan
License
This project is licensed under the MIT License.
Project details
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
File details
Details for the file topsis_sidharth_102218069-0.1.tar.gz
.
File metadata
- Download URL: topsis_sidharth_102218069-0.1.tar.gz
- Upload date:
- Size: 4.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.11.9
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 06070f29dc6bc4a751d09a824c6eec5f2d5adc3fe4af99544125323b782b77c5 |
|
MD5 | b92cd60d4530d8606155927c7cd71779 |
|
BLAKE2b-256 | 9a31686c86c0800122617e8410d2e06f43d2c02176dab6d8699c07bd2815dcb5 |
File details
Details for the file topsis_sidharth_102218069-0.1-py3-none-any.whl
.
File metadata
- Download URL: topsis_sidharth_102218069-0.1-py3-none-any.whl
- Upload date:
- Size: 4.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.11.9
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1d22e1835fbb1bb7b790a16618bc99e21a23e2bd178c8df365d635288c146520 |
|
MD5 | bd0f8dd1aeb16290cf59951c4d911e72 |
|
BLAKE2b-256 | c1f01717afc1c0d8f03c8c28d1c6bfc889956513f2aa3a16e8f3703e80b63eb5 |