Skip to main content

A package to find the topsis score

Project description

Package for calculating TOPSIS score and ranking of a given dataframe

Submitted by:

  • Prabhnoor Singh
  • 102083037
  • 3CO12

Description

The Technique for Order of Preference by Similarity to Ideal Solution (TOPSIS) is a multiple-criteria decision making (MCDM) method.

1. Usage

a) topsis.norm_dataframe(data)

Normalize all the columns except 1st(treated as index); distributive normalization

b) topsis.topsis_calc(data,weights,impacts)

Calculates and returns the topsis score and rank for the given arguments

2. Arguments

a) topsis.norm_dataframe(data)
  1. data
A dataframe with m rows and n columns; First column is treated as index; All the calculations are done from second column onwards
b) topsis.topsis_calc(data,weights,impacts)
  1. data
A dataframe with m rows for m alternatives and n columns for n-1 criterions. First column is treated as index
  1. weights
A numeric list with length equal to number of columns (from second to last columns) in dataframe for weights of criterions.
  1. impacts
A character list of "+" and "-" signs for the way that each criterion influences on the alternatives.

3. Value (return)

a) topsis.norm_dataframe(data)

A normalized dataframe (distributive normalization)

b) topsis.topsis_calc(data,weights,impacts)

Input dataframe with 2 additional columns

  • TOPSIS Score

    TOPSIS score of alternatives.

  • Rank

    Rank of alternatives based on TOPSIS scores.

4. Installation

> pip install Topsis-Prabhnoor-102083037

5. Example

>>> import pandas as pd
>>> from topsispackage_prabhnoorsingh import topsis
>>> raw=pd.DataFrame({"CR": ['M1', 'M2', 'M3', 'M4', 'M5'], "A": [250, 200, 300, 275, 225], "B": [16, 16, 32, 32, 16], "C": [12, 8, 16, 8, 16], "D": [5, 3, 4, 4, 2]})
>>> w=[0.25,0.25,0.25,0.25]
>>> i=['-','+','+','+']
>>> topsis.norm_dataframe(raw)
>>> topsis.topsis_calc(raw,w,i)

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-Prabhnoor-102083037-1.0.0.tar.gz (3.6 kB view details)

Uploaded Source

Built Distribution

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

Topsis_Prabhnoor_102083037-1.0.0-py3-none-any.whl (4.1 kB view details)

Uploaded Python 3

File details

Details for the file Topsis-Prabhnoor-102083037-1.0.0.tar.gz.

File metadata

  • Download URL: Topsis-Prabhnoor-102083037-1.0.0.tar.gz
  • Upload date:
  • Size: 3.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.8.0 pkginfo/1.8.2 readme-renderer/32.0 requests/2.27.1 requests-toolbelt/0.9.1 urllib3/1.26.8 tqdm/4.62.3 importlib-metadata/4.11.1 keyring/23.5.0 rfc3986/2.0.0 colorama/0.4.4 CPython/3.8.12

File hashes

Hashes for Topsis-Prabhnoor-102083037-1.0.0.tar.gz
Algorithm Hash digest
SHA256 e97350d81ce2485b9b8a27000cf5a38d77feada2f064b98c4c8e7207842b68b2
MD5 11f10b1ea265d22ff99d81563c6af04c
BLAKE2b-256 1c160dcba00bd8cc27679592aa34b9f2d060532bb80369a4cd517f5844a5a44f

See more details on using hashes here.

File details

Details for the file Topsis_Prabhnoor_102083037-1.0.0-py3-none-any.whl.

File metadata

  • Download URL: Topsis_Prabhnoor_102083037-1.0.0-py3-none-any.whl
  • Upload date:
  • Size: 4.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.8.0 pkginfo/1.8.2 readme-renderer/32.0 requests/2.27.1 requests-toolbelt/0.9.1 urllib3/1.26.8 tqdm/4.62.3 importlib-metadata/4.11.1 keyring/23.5.0 rfc3986/2.0.0 colorama/0.4.4 CPython/3.8.12

File hashes

Hashes for Topsis_Prabhnoor_102083037-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 e49bd6c17bd6c31fcb5329c0ea29c764220076ceef5baf451ebb11a9b556c5eb
MD5 82709d6c21b5eb59a2176a2a46bd01ae
BLAKE2b-256 4f00df5ca30fd9d85fe3816763c8bf1a061137304803c95e960127cb582b9115

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