Catalog PyPI
PACKAGE EXPLORERView in registry

102216005-Topsis

PyPI

A Python implementation of the TOPSIS decision-making method

Versions collected1
Direct dependencies2From release 1.0.1
Last observed20 Oct, 15:09 UTC

README

Version 1.0.1 documentation

README

TOPSIS Analysis in Jupyter Notebook

This README provides step-by-step instructions on how to use the TOPSIS package in a Jupyter Notebook.


Installation

Before running the TOPSIS function, ensure the package is installed. You can either install it from PyPI or locally:

From PyPI:

!pip install Topsis_102216005

Locally:

If the package is not uploaded to PyPI, navigate to the folder containing the setup.py file and run:

!pip install .

Usage

Step 1: Import the Package

Use the following code to import the topsis function:

from Topsis_102216005 import topsis

Step 2: Prepare Input Data

Ensure you have a CSV file (e.g., data.csv) with the following structure:

  1. First column: Object/variable names (e.g., M1, M2, M3).
  2. Second to last columns: Numeric data for evaluation.

Example CSV (data.csv):

ObjectCriterion 1Criterion 2Criterion 3Criterion 4
M125016125
M220012158
M330018106
M427520147

Step 3: Define Inputs

Specify the following parameters:

  • input_file: Path to the CSV file (e.g., data.csv).
  • weights: Comma-separated weights for the criteria (e.g., 1,1,1,2).
  • impacts: Comma-separated impacts (+ for beneficial, - for non-beneficial, e.g., +,+,-,+).
  • output_file: Name of the output file to save the results (e.g., result.csv).

Step 4: Run the TOPSIS Function

Use the following code to run the TOPSIS analysis:

# Import the necessary function
from Topsis_102216005 import topsis

# Define inputs
input_file = "data.csv"
weights = "1,1,1,2"
impacts = "+,+,-,+"
output_file = "result.csv"

# Run TOPSIS
topsis(input_file, weights, impacts, output_file)

# Display the output file (optional)
import pandas as pd
result = pd.read_csv(output_file)
print(result)

Step 5: Output

The output CSV file (result.csv) will include all original columns, along with two additional columns:

  1. Topsis Score: The computed TOPSIS score for each object.
  2. Rank: The rank of each object based on the TOPSIS score (higher score = better rank).

Example Output (result.csv):

ObjectCriterion 1Criterion 2Criterion 3Criterion 4Topsis ScoreRank
M1250161250.851
M2200121580.653
M3300181060.702
M4275201470.604

Downloads & popularity

Awaiting observations

No metric observations yet

Download counts and popularity will appear here as the collector receives them.

Versions 1

Collected releases
VersionPublishedDirect dependenciesOpen version
1.0.119 Jan 20252

Package advisories

0
No matching advisories collected

This describes our collected data; it is not a security assessment.

Repository

PENDING
reetinder932/topsis

Shared repository data · GitHub

License detected in repository
Not collected

Metadata history

Meaningful changes
Current collected state Current

Observed since 20 Oct, 15:09 UTC

No superseded metadata states collected. Unchanged observations do not create new revisions.

Record identity

package:7e0c0823753d50229fa1ad6f16bde2c267b9cd93baf34c5b168bed6ca594fbd1