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_angadsingh_102203314-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_angadSingh_102203314-1.0.0-py3-none-any.whl (4.9 kB view details)

Uploaded Python 3

File details

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

File metadata

File hashes

Hashes for topsis_angadsingh_102203314-1.0.0.tar.gz
Algorithm Hash digest
SHA256 7b0027199434a14d283ac2e857c8dc15211d9483ce659d6fbdc7eb2da0366c82
MD5 3fb6f087106b984a1410ff2a539c4bcd
BLAKE2b-256 a2cf24e9884ef41d81acd33a5a61ca7bf3d22d7199f3e7a0da3b2e23c4502bfb

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for topsis_angadSingh_102203314-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 9f97371be64ae745291081e828cf70b06043050e12ee4d4a350623047b518c5c
MD5 8a2966e4f1aab3c01a17155552fbda64
BLAKE2b-256 f8e8e0a946bd080483197b8ab09e2e357ad5accb7756ba9d0f8df7add06a88b8

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