Skip to main content

This package performs the topsis(multiple criterion decision making) on a pandas dataframe and return the rank and topsis score.

Project description

Topsis_102017182

Topsis

Technique for Order Preference by Similarity to Ideal Solution (TOPSIS)

In a general sense, it is the aspiration of human being to make "calculated" decision in a position of multiple selection. In scientific terms, it is the intention to develop analytical and numerical methods that take into account multiple alternatives with multiple criteria. TOPSIS (Technique for Order Preference by Similarity to Ideal Solution) is one of the numerical methods of the multi-criteria decision making

Installation

Use the package manager pip to install the package

pip install Topsis_102017182_sandhya_goyal

Import

from Topsis_102017182_sandhya_goyal import topsis

Usage

topsis module has a function names get_score which takes 3 arguements as:

  1. dataframe - It is a pandas dataframe which has atleast 3 columns(including the first column with names). It should only have numerical values. Any non-numerical value should be encoded before passing it to function.
  2. weights - It is a string of comma(,) separated numbers which tell the weight of each criteria.
  3. impacts - It is a string of comma(,) separated + and - sign showing the impact of criteria on decision making.

The function return the original pandas dataframe with 2 more columns added, which are Topsis Score and Rank.

topsis.get_score(dataframe,weights,impacts)

Example

data.csv (Input):

contestent sur tal lah pitch sharpness
a 4 18 6.5 35 15
b 6 14 4 38 19
c 6 12 5 42 20
d 8 26 7 50 25
e 3 14 6 40 14
import pandas as pd
df = pd.read_csv('data.csv')
weights = "+,+,+,+,+"
impacts = "1,1,1,1,1"
print(topsis.get_score(df,weights,impacts))

Output:

contestent sur tal lah pitch sharpness output
a 4 18 6.5 35 15 3
b 6 14 4 38 19 4
c 6 12 5 42 20 2
d 8 26 7 50 25 1
e 3 14 6 40 14 5

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_102017182_sandhya_goyal-1.0.0.tar.gz (4.4 kB view details)

Uploaded Source

Built Distribution

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

File details

Details for the file Topsis_102017182_sandhya_goyal-1.0.0.tar.gz.

File metadata

File hashes

Hashes for Topsis_102017182_sandhya_goyal-1.0.0.tar.gz
Algorithm Hash digest
SHA256 cbde21432ce8531664c18d56a4efa6ee5acd9c6a10589a7d9ce6f54495abb78a
MD5 9268fbe3b9bb42c50b0ddc88d6e0d681
BLAKE2b-256 26768fca0427b6b9dd15ab48511b6d939b63da45ccc847b3a39bd3da2707cb69

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for Topsis_102017182_sandhya_goyal-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 c39536d35d9e9e4e1e5a564b9b49994947264ba3aefadb86a046b6a1f790da5f
MD5 49d8fa72579a6b78e56ed859597e918d
BLAKE2b-256 b5d1893b90cdc713a666f62e231be9a25985844616f2c694eb1a0eeb0cead682

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