Skip to main content

TOPSIS implementation

Project description

TOPSIS Python Package

📌 About TOPSIS

TOPSIS (Technique for Order Preference by Similarity to Ideal Solution) is a multi-criteria decision-making (MCDM) method. It helps in ranking alternatives based on their distance from the ideal best and ideal worst solutions.

This package provides a command-line implementation of TOPSIS in Python.

📦 Installation

Install the package from PyPI using:

pip install Topsis-Vansh-102303641

🚀 Usage

The package can be used directly from the command line.

🔹 Command Format

topsis <inputFileName> <weights> <impacts> <outputFileName>

🔹 Example

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

📄 Input File Format

The first column should contain the names of alternatives.

From second column to last column, values must be numeric.

The file must contain at least 3 columns.

✔ Example Input (data.csv)

Fund Name,P1,P2,P3,P4
M1,0.67,0.45,6.5,42.6
M2,0.6,0.36,3.6,53.3
M3,0.82,0.67,3.8,63.1
M4,0.6,0.36,3.5,69.2

📤 Output File Format

The output file will contain two additional columns:

  • Topsis Score
  • Rank

✔ Example Output (result.csv)

Fund Name,P1,P2,P3,P4,Topsis Score,Rank
M1,0.67,0.45,6.5,42.6,0.61,2
M2,0.6,0.36,3.6,53.3,0.42,4
M3,0.82,0.67,3.8,63.1,0.78,1
M4,0.6,0.36,3.5,69.2,0.35,5

⚠️ Error Handling

The program checks for the following errors:

  • Incorrect number of command-line arguments
  • Input file not found
  • Less than 3 columns in input file
  • Non-numeric values in criteria columns
  • Number of weights, impacts, and criteria mismatch
  • Impacts other than + or -
  • Weights and impacts not separated by commas

Appropriate error messages are displayed for invalid inputs.

🛠 Requirements

  • Python 3.x
  • pandas
  • numpy

👨‍💻 Author

Name: Vansh

Roll Number: 102303641

Course: B.Tech (Computer Engineering)

📄 License

This project is licensed 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_vansh_102303641-0.0.1.tar.gz (4.0 kB view details)

Uploaded Source

Built Distribution

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

topsis_vansh_102303641-0.0.1-py3-none-any.whl (4.7 kB view details)

Uploaded Python 3

File details

Details for the file topsis_vansh_102303641-0.0.1.tar.gz.

File metadata

  • Download URL: topsis_vansh_102303641-0.0.1.tar.gz
  • Upload date:
  • Size: 4.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.9

File hashes

Hashes for topsis_vansh_102303641-0.0.1.tar.gz
Algorithm Hash digest
SHA256 bdcac5f6024a00de96fdf77d1b5f086b96d700a3b718ec577cd3ad27d8e56d30
MD5 15229783fc3093e6cfbe7ad58535af1d
BLAKE2b-256 ad758f2191121d2d8b42d44e72f2b8b881fcedb65456e733b9de30eeb2e54ec4

See more details on using hashes here.

File details

Details for the file topsis_vansh_102303641-0.0.1-py3-none-any.whl.

File metadata

File hashes

Hashes for topsis_vansh_102303641-0.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 d63e68a61e96225158d3cc25d18775c0459e9f9792cd871ab082ec37b7336587
MD5 5db6887900d0a84b9c2fa7acd2b360ae
BLAKE2b-256 55590df6406ccc88379fa264a894ad390d0d7a4a57c51381dd37c65e20ae42dd

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