Skip to main content

A Python implementation of TOPSIS (Technique for Order Preference by Similarity to Ideal Solution)

Project description

TOPSIS Python Package

Overview

TOPSIS (Technique for Order of Preference by Similarity to Ideal Solution) is a multi-criteria decision analysis (MCDA) method for ranking and selecting alternatives based on multiple criteria.

Features

  • Ranking of options based on multiple criteria
  • Flexible weight and impact specification
  • Ideal solution distance calculation
  • CSV input and output support

Installation

pip install Topsis-Ansh-102303380

Usage

Command-Line Syntax

python -m Topsis inputFileName "weights(comma separated)" "impacts(comma separated)" outputFileName

Example

python3 -m Topsis Topsis/data.csv "1,1,2,2,1" "+,+,-,-,-" my-result.csv

Input Output Format

Input File

Fund Name P1 P2 P3 P4 P5
M1 0.67 0.45 6.5 42.6 12.56
M2 0.60 0.36 3.6 53.3 14.47
M3 0.82 0.67 3.8 63.1 17.10
M4 0.60 0.36 3.5 69.2 18.42
M5 0.76 0.58 4.8 43.0 12.29
M6 0.69 0.48 6.6 48.7 14.12
M7 0.79 0.62 4.8 59.2 16.35
M8 0.84 0.71 6.5 34.5 10.64

Output File

Fund Name P1 P2 P3 P4 P5 Topsis Score Rank
M1 0.67 0.45 6.5 42.6 12.56 20.58 2
M2 0.60 0.36 3.6 53.3 14.47 40.83 4
M3 0.82 0.67 3.8 63.1 17.10 30.07 3
M4 0.60 0.36 3.5 69.2 18.42 50.22 5
M5 0.76 0.58 4.8 43.0 12.29 10.41 1
M6 0.69 0.48 6.6 48.7 14.12 80.51 8
M7 0.79 0.62 4.8 59.2 16.35 70.74 7
M8 0.84 0.71 6.5 34.5 10.64 60.33 6

Note: Your input data and output result may be different.

License

© 2026 Ansh Mahajan 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_ansh_102303380-1.0.3.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_ansh_102303380-1.0.3-py3-none-any.whl (4.8 kB view details)

Uploaded Python 3

File details

Details for the file topsis_ansh_102303380-1.0.3.tar.gz.

File metadata

  • Download URL: topsis_ansh_102303380-1.0.3.tar.gz
  • Upload date:
  • Size: 4.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.1

File hashes

Hashes for topsis_ansh_102303380-1.0.3.tar.gz
Algorithm Hash digest
SHA256 21ccac705466133b70956d98fca38c1b1ab682eab948cc3c670aef46b3729601
MD5 d6c83b5d37c5ade6c31b8778cb40dc0e
BLAKE2b-256 47b68d86051356fe841eae4bd323ed8582408027c0b08a95ccc497d8e100a512

See more details on using hashes here.

File details

Details for the file topsis_ansh_102303380-1.0.3-py3-none-any.whl.

File metadata

File hashes

Hashes for topsis_ansh_102303380-1.0.3-py3-none-any.whl
Algorithm Hash digest
SHA256 d95beef1a9f1c7e59f1139dce56df36fa59582a4792a86bda071e661e7d6baab
MD5 7f4f7211ed4ef47eaa63e72f0b05a43f
BLAKE2b-256 854cf3885afc5eded2f4fd590116b10e4d22459dfcc04391e47409f97d1436e9

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