Skip to main content

TOPSIS implementation as a Python package

Project description

USER MANUAL

TOPSIS – Arihan (102303750)


1. Overview

topsis-arihan-102303750 is a Python command-line tool that implements the
Technique for Order Preference by Similarity to Ideal Solution (TOPSIS).

TOPSIS is a Multi-Criteria Decision Making (MCDM) technique used to rank a set of alternatives based on multiple evaluation criteria.
The alternative closest to the ideal best solution and farthest from the ideal worst solution is ranked highest.


2. System Requirements

  • Python version 3.7 or higher
  • Operating System: Windows / macOS / Linux
  • Python packages: numpy, pandas

3. Installation

Install the package from PyPI using pip:

pip install topsis-arihan-102303750

After installation, the command topsis becomes available in the terminal.

4. Command-Line Usage

4.1 General Syntax

Enter CSV filename followed by .csv extension, then enter the weights vector with vector values separated by commas, followed by the impacts vector with comma separated signs (+,-)

topsis <InputDataFile> <Weights> <Impacts> <OutputFile>

Example

topsis data.csv "1,1,1,1,2" "+,+,-,+,+" output.csv

4.2 Description of Parameters

InputDataFile
CSV file containing the alternatives and criteria.

Weights
Comma-separated numeric values representing the importance of each criterion.

Impacts
Comma-separated symbols indicating the nature of each criterion:
+ → Benefit criterion (higher value is better)
- → Cost criterion (lower value is better)

OutputFile
Name of the CSV file where results will be saved.


5. Example Usage

5.1 Input File (data.csv)

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
M3,0.79,0.62,4.8,46.7,13.23
M4,0.78,0.61,6.4,42.4,12.55
M5,0.94,0.88,3.6,62.2,16.91
M6,0.88,0.77,6.5,51.5,14.91
M7,0.66,0.44,5.3,48.9,13.83
M8,0.93,0.86,3.4,37.0,10.55

The first column is treated as an identifier (Fund Name).
All remaining columns must contain numeric criteria.


5.2 Weights and Impacts Used

Weights:
1,1,1,1,2

Impacts:
+,+,-,+,+


5.3 Command Executed

topsis data.csv "1,1,1,1,2" "+,+,-,+,+" output.csv

6. Output Description

The output file contains:

  • Original data
  • Topsis Score (closeness coefficient)
  • Rank (1 indicates the best alternative)

6.1 Output File (output.csv)

Fund Name,P1,P2,P3,P4,P5,Topsis Score,Rank
M1,0.84,0.71,6.7,42.1,12.59,0.38,6
M2,0.91,0.83,7.0,31.7,10.11,0.31,8
M3,0.79,0.62,4.8,46.7,13.23,0.48,3
M4,0.78,0.61,6.4,42.4,12.55,0.34,7
M5,0.94,0.88,3.6,62.2,16.91,0.98,1
M6,0.88,0.77,6.5,51.5,14.91,0.59,2
M7,0.66,0.44,5.3,48.9,13.83,0.44,5
M8,0.93,0.86,3.4,37.0,10.55,0.46,4

7. Assumptions and Constraints

  • Input CSV must contain only numeric values after the first column.
  • Number of weights and impacts must match the number of criteria.
  • Higher TOPSIS score implies better ranking.
  • Missing or categorical values are not supported.

8. Error Handling

The program performs validation and displays appropriate error messages for:

  • Incorrect number of command-line arguments.
  • File not found.
  • Non-numeric values in criteria columns.
  • Mismatch in number of criteria, weights, and impacts.
  • Invalid impact symbols (only + and - allowed).

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_arihan_102303750-0.0.5.tar.gz (3.7 kB view details)

Uploaded Source

Built Distribution

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

topsis_arihan_102303750-0.0.5-py3-none-any.whl (4.2 kB view details)

Uploaded Python 3

File details

Details for the file topsis_arihan_102303750-0.0.5.tar.gz.

File metadata

  • Download URL: topsis_arihan_102303750-0.0.5.tar.gz
  • Upload date:
  • Size: 3.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.0

File hashes

Hashes for topsis_arihan_102303750-0.0.5.tar.gz
Algorithm Hash digest
SHA256 fd89e4d1c5fd1a0c3c520d3de73576855cec7ea70b1e2494c6dbb2bf0effa307
MD5 3101ffdab03cebc68540fc76d2a41ad9
BLAKE2b-256 ba52711286dc7d537d49e1f32049d9278da09fa28bf9edc7f82176d6a6f4f4b4

See more details on using hashes here.

File details

Details for the file topsis_arihan_102303750-0.0.5-py3-none-any.whl.

File metadata

File hashes

Hashes for topsis_arihan_102303750-0.0.5-py3-none-any.whl
Algorithm Hash digest
SHA256 5d8a8062ef731db7d072beacd84607cb8483ec7e7d700c472c7310e42b856bcf
MD5 e9e3f3bc44c6e4680a55f9f7fd9643db
BLAKE2b-256 314dab7131a11f9e5c11df9796f1876d2dc4605e7d9f4362a1a0cbd1c9a1d28f

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