Skip to main content

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

  1. The input file must be a .csv format with a minimum of 3 columns.
  2. The first column can contain non-numeric values (e.g., identifiers).
  3. 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 Score and Rank.
    • Saves the processed results to the specified output file.

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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

topsis_sachet_102203345-1.0.0.tar.gz (4.5 kB view details)

Uploaded Source

Built Distribution

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

topsis_sachet_102203345-1.0.0-py3-none-any.whl (5.1 kB view details)

Uploaded Python 3

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

Hashes for topsis_sachet_102203345-1.0.0.tar.gz
Algorithm Hash digest
SHA256 bf2858ebc8e2f0b053da849a9a592942956708a5252d728b3699b52543820b05
MD5 b08271b120b1c89b9eb962b46f58141e
BLAKE2b-256 e5c42c6d57ffbf9bde22b3b1b6aa03ccf4b0ad0cff484d110bbb1c90b660e004

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for topsis_sachet_102203345-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 609156417111f4f46cde905783a267abc5a44a22d3afa210e60fead557dec651
MD5 fd0cad334af830ee7e79347908f1b66c
BLAKE2b-256 44912cc649dd706f61447297ae3cefdd2b4c9ad72e2e9feed237f446a1fc7ef6

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