Skip to main content

TOPSIS Implementation in Python...


Overview

This Python script implements the TOPSIS (Technique for Order of Preference by Similarity to Ideal Solution) method for multi-criteria decision-making. It calculates the performance score and rank for given data based on user-defined weights and impacts.


Usage

Run the script with the following command:

python topsis.py <inputFileName> <weights> <impacts> <resultFileName>
  • <inputFileName>: Path to the CSV file containing the dataset.
  • <weights>: Comma-separated weights for the criteria (e.g., 1,2,3).
  • <impacts>: Comma-separated impacts for the criteria (+ for benefit, - for cost).
  • <resultFileName>: Name of the output file where results will be saved.

Input File Requirements

  1. Must be a .csv file with at least 3 columns.
  2. The first column can contain non-numeric values (e.g., IDs).
  3. Columns from the 2nd to the last must contain numeric values only.

Features

  • Validation:
    • Ensures correct number of inputs.
    • Validates weights, impacts, and column counts.
    • Handles missing or invalid files.
  • Error Handling:
    • Displays user-friendly messages for issues like file not found, non-numeric data, or mismatched input parameters.
  • Output:
    • Adds two new columns: Topsis Score and Rank.
    • Saves the results in the specified output file.

Dependencies

  • Python 3.x
  • Required libraries: pandas, math, sys

Install dependencies using:

pip install pandas

License

This project is open-source and free to use under the MIT License.

Metadata

Release files for abhishek-topsis 0.0.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for abhishek-topsis 0.0.1
File Size Uploaded Provenance
abhishek_topsis-0.0.1.tar.gz 3.8 kB Without provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for abhishek-topsis 0.0.1
File Interpreter ABI Platform
abhishek_topsis-0.0.1-py3-none-any.whl Python 3 none any Details

Total release size: 7.8 kB

Release files / abhishek_topsis-0.0.1.tar.gz

Download URL abhishek_topsis-0.0.1.tar.gz
Size 3.8 kB
Tags Source
SHA-256 checksum
How to use checksums
c639c6b419c970b1d4e3613b880d3dc6a09dc346fa674be16399ef0b777228dd
BLAKE2b-256 checksum
How to use checksums
0eb6878577af5d935cd757910b5a6a5412ba340171f69f73dec6a77d9bb1878b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.0.1 CPython/3.12.1

Release files / abhishek_topsis-0.0.1-py3-none-any.whl

Download URL abhishek_topsis-0.0.1-py3-none-any.whl
Size 4.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
ff7744382e2248e5cd4135fb61ab5bab124693da56014b0111b85450ece4dbb6
BLAKE2b-256 checksum
How to use checksums
0b91fb7998c5a5802739407c19093750b457a6da5df6668f6e940aef198fad7a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.0.1 CPython/3.12.1

Security for abhishek-topsis 0.0.1

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.0.1 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page