Skip to main content

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_102216095

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):

Object Criterion 1 Criterion 2 Criterion 3 Criterion 4
M1 250 16 12 5
M2 200 12 15 8
M3 300 18 10 6
M4 275 20 14 7

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):

Object Criterion 1 Criterion 2 Criterion 3 Criterion 4 Topsis Score Rank
M1 250 16 12 5 0.85 1
M2 200 12 15 8 0.65 3
M3 300 18 10 6 0.70 2
M4 275 20 14 7 0.60 4

Metadata

Release files for 102216095-Topsis 1.0.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for 102216095-Topsis 1.0.1
File Size Uploaded Provenance Actions
102216095_topsis-1.0.1.tar.gz 3.8 kB Without provenance Details for 102216095_topsis-1.0.1.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for 102216095-Topsis 1.0.1
File Interpreter ABI Platform Actions
102216095_Topsis-1.0.1-py3-none-any.whl Python 3 none any Details for 102216095_Topsis-1.0.1-py3-none-any.whl

Total release size: 8.2 kB

Release files / 102216095_topsis-1.0.1.tar.gz

Download URL 102216095_topsis-1.0.1.tar.gz
Size 3.8 kB
Tags Source
SHA-256 checksum
How to use checksums
63750f9538ac0f6badfb382c48058512de9d615a099db2d2aafead90f45f25a5
BLAKE2b-256 checksum
How to use checksums
5bbc9d3f8a3445037b4563213a11ca16b51a64a1c850a951a5ea617a14922cae
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.12.3

Release files / 102216095_Topsis-1.0.1-py3-none-any.whl

Download URL 102216095_Topsis-1.0.1-py3-none-any.whl
Size 4.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
d5ce726cfab0c622ce23723d9ee354a1b3a3ca377e0689ece7ee3701af3fce6e
BLAKE2b-256 checksum
How to use checksums
f7bb060489adf037379042d30ac2820acf2fe4f2a3bba335337e66f9378c928a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.12.3

Security for 102216095-Topsis 1.0.1

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

1.0.1 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page