Skip to main content

A Python package to perform TOPSIS (Technique for Order Preference by Similarity to Ideal Solution)

Project description

Topsis_Tanvi_102213024

Topsis_Tanvi_102213024is a Python package for implementing the Technique for Order Preference by Similarity to Ideal Solution (TOPSIS). It is a popular multi-criteria decision-making method used to rank alternatives based on their relative closeness to the ideal solution.

Installation

You can install the package using pip:

pip install Topsis_Tanvi_102213024

Usage

Input File Format

The input CSV file must follow this structure:

  • The first column should contain the names of the alternatives (e.g., products, models, or options).
  • Subsequent columns should contain the numerical values of the criteria for each alternative.
  • The first row should provide headers for all columns.

Example

Suppose you have an input CSV file named data.csv with the following content:

Model Price Battery Life Performance Portability
m1 300 10 8 6
m2 250 8 7 9
m3 400 9 9 5

You want to apply the TOPSIS method with the following parameters:

  • Weights for the criteria: Price (0.5), Battery Life (0.3), Performance (0.2)
  • Impacts for the criteria: Price (-), Battery Life (+), Performance (+)

The command would be:

topsis data.csv "0.5,0.3,0.2" "-,+,+" results.csv


### Command-line Usage

After installation, you can use the `topsis` command in the terminal:

```bash
topsis <input_file> <weights> <impacts> <output_file>
  • <input_file>: Path to the input CSV file.
  • <weights>: Comma-separated string of weights for the criteria.
  • <impacts>: Comma-separated string of '+' or '-' indicating the desirability of the criteria.
  • <output_file>: Path to the output CSV file to save the results.

Example

topsis data.csv "0.5,0.3,0.2" "+,-,+" results.csv

This command will process the data.csv file using the specified weights and impacts and output the results to results.csv.

NOTE

  • Ensure the input file contains at least three columns: one for alternatives and at least two for criteria.
  • All criteria values should be numerical.
  • The number of weights and impacts should match the number of criteria columns.
  • Impacts must only include + (beneficial) or - (non-beneficial).

License

This project is licensed under the MIT License. See the LICENSE file for details.

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_tanvi_102213024-1.0.2.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_Tanvi_102213024-1.0.2-py3-none-any.whl (4.7 kB view details)

Uploaded Python 3

File details

Details for the file topsis_tanvi_102213024-1.0.2.tar.gz.

File metadata

  • Download URL: topsis_tanvi_102213024-1.0.2.tar.gz
  • Upload date:
  • Size: 4.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.0.1 CPython/3.13.0

File hashes

Hashes for topsis_tanvi_102213024-1.0.2.tar.gz
Algorithm Hash digest
SHA256 a3b5c803a4c2833832be3804a16c49d8e4bbe79c06bf59b737588ba7488db382
MD5 01b70bf905692f7436a7d22e33e564df
BLAKE2b-256 78a175b3864b067f1c445bc6b749e8df67a9e96b97bd439e17a2d27d03792e8b

See more details on using hashes here.

File details

Details for the file Topsis_Tanvi_102213024-1.0.2-py3-none-any.whl.

File metadata

File hashes

Hashes for Topsis_Tanvi_102213024-1.0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 f184732c0d0bdc28e475180f08740e1918a24dceeb844631d6b596a45a61f6e3
MD5 050adbb7ae6981e97527128296aecb81
BLAKE2b-256 61a94ec7de6bc83cbfb8bf76cd5d6cf38fe06ef7f21cb1836b0c9552448bf130

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