Topsis-Keshav-Garg-102017064


NameTopsis-Keshav-Garg-102017064 JSON
Version 0.0.1 PyPI version JSON
download
home_pagehttps://github.com/keshavgarg23/Topsis-Keshav-102017064
SummaryThis package performs the topsis(multiple criterion decision making) on a pandas dataframe and return the rank and topsis score.
upload_time2023-01-21 10:04:56
maintainer
docs_urlNone
authorKeshav Garg
requires_python
licenseMIT
keywords topsis mcdm decision making
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # Topsis
This is a python library which implements topsis.Topsis is a technique which is used for Multiple Criteria Decision Making(MCDM). It takes weights and impacts of criteria does the decision making by calculating the similarity to ideal solution.


## Installation
Use the package manager [pip](https://pip.pypa.io/en/stable/) to install the package
```
pip install Topsis_Keshav_Garg_102017064
```


## Import

```
from Topsis_Keshav_Garg_102017064 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

test.csv (Input):

|mobile|ram|memo|display|battery|price|
|------|---|----|-------|-------|-----|
|a|4|128|6.5|3500|15000|
|b|6|64|6.4|3800|16000|
|c|6|128|6.8|4200|19000|
|d|8|256|7|5000|25000|
|e|3|64|6.2|4000|14000|


```
from Topsis_Keshav_Garg_102017064 import topsis
import pandas as pd
df = pd.read_csv('./test.csv')
weights = "+,+,+,+,-"
impacts = "1,1,1,1,1"
print(topsis.get_score(df,weights,impacts))
```

Output:
|  |mobile|  ram|  memo|  display|  battery|  price|  Topsis Score|  Rank|
|--|------|----|--------|--------|-------|-------|----------|-------|
|0      |a    |4   |128    |6.5     |3500|  15000|     0.379477|     3|
|1      |b    |6   |64     |6.4     |3800|  16000|      0.341963|     4|
|2      |c    |6   |128    |6.8     |4200|  19000|      0.439078|     2|
|3      |d    |8   |256    |7.0     |5000|  25000|      0.729791|    1|
|4      |e    |3   |64     |6.2     |4000|  14000|      0.276912|     5|


            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/keshavgarg23/Topsis-Keshav-102017064",
    "name": "Topsis-Keshav-Garg-102017064",
    "maintainer": "",
    "docs_url": null,
    "requires_python": "",
    "maintainer_email": "",
    "keywords": "TOPSIS,MCDM,DECISION,MAKING",
    "author": "Keshav Garg",
    "author_email": "gkeshav2309@gmail.com",
    "download_url": "https://files.pythonhosted.org/packages/0a/e8/5f9303ad35e40436868bf44406cd4532aab2fcba8a69e73cc023e9cd7d6c/Topsis_Keshav_Garg_102017064-0.0.1.tar.gz",
    "platform": null,
    "description": "# Topsis\nThis is a python library which implements topsis.Topsis is a technique which is used for Multiple Criteria Decision Making(MCDM). It takes weights and impacts of criteria does the decision making by calculating the similarity to ideal solution.\n\n\n## Installation\nUse the package manager [pip](https://pip.pypa.io/en/stable/) to install the package\n```\npip install Topsis_Keshav_Garg_102017064\n```\n\n\n## Import\n\n```\nfrom Topsis_Keshav_Garg_102017064 import topsis\n```\n\n## Usage\ntopsis module has a function names get_score which takes 3 arguements as:\n1. 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.\n2. weights - It is a string of comma(,) separated numbers which tell the weight of each criteria.\n3. impacts - It is a string of comma(,) separated + and - sign showing the impact of criteria on decision making.\n\nThe function return the original pandas dataframe with 2 more columns added, which are Topsis Score and Rank.\n```\ntopsis.get_score(dataframe,weights,impacts)\n```\n\n\n## Example\n\ntest.csv (Input):\n\n|mobile|ram|memo|display|battery|price|\n|------|---|----|-------|-------|-----|\n|a|4|128|6.5|3500|15000|\n|b|6|64|6.4|3800|16000|\n|c|6|128|6.8|4200|19000|\n|d|8|256|7|5000|25000|\n|e|3|64|6.2|4000|14000|\n\n\n```\nfrom Topsis_Keshav_Garg_102017064 import topsis\nimport pandas as pd\ndf = pd.read_csv('./test.csv')\nweights = \"+,+,+,+,-\"\nimpacts = \"1,1,1,1,1\"\nprint(topsis.get_score(df,weights,impacts))\n```\n\nOutput:\n|  |mobile|  ram|  memo|  display|  battery|  price|  Topsis Score|  Rank|\n|--|------|----|--------|--------|-------|-------|----------|-------|\n|0      |a    |4   |128    |6.5     |3500|  15000|     0.379477|     3|\n|1      |b    |6   |64     |6.4     |3800|  16000|      0.341963|     4|\n|2      |c    |6   |128    |6.8     |4200|  19000|      0.439078|     2|\n|3      |d    |8   |256    |7.0     |5000|  25000|      0.729791|    1|\n|4      |e    |3   |64     |6.2     |4000|  14000|      0.276912|     5|\n\n",
    "bugtrack_url": null,
    "license": "MIT",
    "summary": "This package performs the topsis(multiple criterion decision making) on a pandas dataframe and return the rank and topsis score.",
    "version": "0.0.1",
    "split_keywords": [
        "topsis",
        "mcdm",
        "decision",
        "making"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "e791b2f56914434613439ce765f6aefaea3bb9a4384f3c593f57ada15ec81b48",
                "md5": "f77f52e41196478ac3c9079d1a89daf3",
                "sha256": "ea9971ece01ead39d5b6449d64f4122dcfc220e23035e728da9ba5e99f74221c"
            },
            "downloads": -1,
            "filename": "Topsis_Keshav_Garg_102017064-0.0.1-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "f77f52e41196478ac3c9079d1a89daf3",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": null,
            "size": 4610,
            "upload_time": "2023-01-21T10:04:54",
            "upload_time_iso_8601": "2023-01-21T10:04:54.361852Z",
            "url": "https://files.pythonhosted.org/packages/e7/91/b2f56914434613439ce765f6aefaea3bb9a4384f3c593f57ada15ec81b48/Topsis_Keshav_Garg_102017064-0.0.1-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "0ae85f9303ad35e40436868bf44406cd4532aab2fcba8a69e73cc023e9cd7d6c",
                "md5": "7db3f0c71e7820d336ca2d262dfa9e84",
                "sha256": "0403519bbdda42e8d230b3057291ee823468918fa045878044e2271209091732"
            },
            "downloads": -1,
            "filename": "Topsis_Keshav_Garg_102017064-0.0.1.tar.gz",
            "has_sig": false,
            "md5_digest": "7db3f0c71e7820d336ca2d262dfa9e84",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": null,
            "size": 5850,
            "upload_time": "2023-01-21T10:04:56",
            "upload_time_iso_8601": "2023-01-21T10:04:56.538032Z",
            "url": "https://files.pythonhosted.org/packages/0a/e8/5f9303ad35e40436868bf44406cd4532aab2fcba8a69e73cc023e9cd7d6c/Topsis_Keshav_Garg_102017064-0.0.1.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2023-01-21 10:04:56",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "github_user": "keshavgarg23",
    "github_project": "Topsis-Keshav-102017064",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": false,
    "lcname": "topsis-keshav-garg-102017064"
}
        
Elapsed time: 0.04429s