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-Ravish-102303651

🚀 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: Ravish

Roll Number: 102303651

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_ravish_102303651-0.0.4.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_ravish_102303651-0.0.4-py3-none-any.whl (4.6 kB view details)

Uploaded Python 3

File details

Details for the file topsis_ravish_102303651-0.0.4.tar.gz.

File metadata

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

File hashes

Hashes for topsis_ravish_102303651-0.0.4.tar.gz
Algorithm Hash digest
SHA256 06d3fe00ab49db70aa504332d324e2e7aa4b4164f08a2f7ed29c82667619eb01
MD5 67c4dbb728c7b355fbf9fb33925e1142
BLAKE2b-256 91573df06e99f1024a8f54b291a8f7e42efe4183bcf55309d703cd662c5b8273

See more details on using hashes here.

File details

Details for the file topsis_ravish_102303651-0.0.4-py3-none-any.whl.

File metadata

File hashes

Hashes for topsis_ravish_102303651-0.0.4-py3-none-any.whl
Algorithm Hash digest
SHA256 3b15d574f3faba61b569cd728e2b03c9f9a1511acb40cf86de61ec3681749771
MD5 949c62a56d3a8d0f9be96f0bb9cb83cc
BLAKE2b-256 13420d025d9b827490bfa52f171b9991012dd9ca9cb1cc2cdab0c58d2aaa470c

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