Skip to main content

A Python package to perform TOPSIS analysis on datasets.

Project description

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.

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

topsis_nishchay_102217036-1.0.0.tar.gz (4.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

topsis_nishchay_102217036-1.0.0-py3-none-any.whl (5.0 kB view details)

Uploaded Python 3

File details

Details for the file topsis_nishchay_102217036-1.0.0.tar.gz.

File metadata

File hashes

Hashes for topsis_nishchay_102217036-1.0.0.tar.gz
Algorithm Hash digest
SHA256 9a7fa3a5fb670d030edbe8e3a7355e6d18a943c3d04c9dc6be037c58a16152a4
MD5 fc726542fc27cf0970e51b364f28b6af
BLAKE2b-256 5dbe7afd8eee0db723199449989ae0663d7949188011014805f56dce4e0871bb

See more details on using hashes here.

File details

Details for the file topsis_nishchay_102217036-1.0.0-py3-none-any.whl.

File metadata

File hashes

Hashes for topsis_nishchay_102217036-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 77adf2cb60b0d9ed07e1126520e55cd2ae960c46eec5225f670bfb2e3d9e9835
MD5 865ff7c39b98df4580e5b5501691c8d4
BLAKE2b-256 16af6fbed8db856923c8cf437875ccaf8de1f026c57a0f313a148e34097e99f1

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page