# Project Description
- for: Assignment-1(UCS654)
- Submitted by: Himanshu Bansal
- Roll no: 102103568
- Group: 3COE20
# TOPSIS (Technique for Order of Preference by Similarity to Ideal Solution)
This Python script implements the TOPSIS method for multi-criteria decision-making. It takes a CSV file containing a decision matrix, weights, and impacts as input, and produces a ranked result based on the TOPSIS score.
## Installation
```bash
pip install Topsis-Himanshu-102103568
```
## Usage
```bash
from Topsis_Himanshu_102103568.topsis import topsis
inputFile="sample.csv"
weights="1,1,1,1"
impacts="-,+,+,+"
resultFile="result.csv"
topsis(inputFile, weights, impacts, resultFile)
```
OR
You can use this package via command line as:
```bash
python -m Topsis_Himanshu_102103568.topsis [InputDataFile as .csv] [Weights as a string] [Impacts as a string] [ResultFileName as .csv]
```
- `InputDataFile`: Path to the CSV file containing the input data.
- `Weights`: Comma-separated weights for each criterion.
- `Impacts`: Comma-separated impact direction for each criterion (`+` for maximization, `-` for minimization).
- `ResultFileName`: Name of the file to save the TOPSIS results.
## Requirements
- Python 3
- pandas
- numpy
## Input File Format
The input data should be in a CSV format with the following structure:
| Fund Name | P1 | P2 | P3 | P4 | P5 |
|-----------|------|------|------|------|-------|
| M1 | 0.84 | 0.71 | 6.7 | 42.1 | 12.59 |
| M2 | 0.91 | 0.83 | 7 | 31.7 | 10.11 |
| M3 | 0.79 | 0.62 | 4.8 | 46.7 | 13.23 |
| M4 | 0.78 | 0.61 | 6.4 | 42.4 | 12.55 |
| M5 | 0.94 | 0.88 | 3.6 | 62.2 | 16.91 |
| M6 | 0.88 | 0.77 | 6.5 | 51.5 | 14.91 |
| M7 | 0.66 | 0.44 | 5.3 | 48.9 | 13.83 |
| M8 | 0.93 | 0.86 | 3.4 | 37 | 10.55 |
## Output
The script generates a CSV file containing the TOPSIS score and rank for each object:
| Fund Name | P1 | P2 | P3 | P4 | P5 | Topsis Score | Rank |
|-----------|------|------|------|------|-------|----------------------|------|
| M1 | 0.84 | 0.71 | 6.7 | 42.1 | 12.59 | 0.41855328299643013 | 7.0 |
| M2 | 0.91 | 0.83 | 7.0 | 31.7 | 10.11 | 0.4663977143091959 | 5.0 |
| M3 | 0.79 | 0.62 | 4.8 | 46.7 | 13.23 | 0.5374784843237046 | 3.0 |
| M4 | 0.78 | 0.61 | 6.4 | 42.4 | 12.55 | 0.4295182212044884 | 6.0 |
| M5 | 0.94 | 0.88 | 3.6 | 62.2 | 16.91 | 0.5453066145383307 | 2.0 |
| M6 | 0.88 | 0.77 | 6.5 | 51.5 | 14.91 | 0.39814192807166954 | 8.0 |
| M7 | 0.66 | 0.44 | 5.3 | 48.9 | 13.83 | 0.4743648907682155 | 4.0 |
| M8 | 0.93 | 0.86 | 3.4 | 37.0 | 10.55 | 0.6392872727749049 | 1.0 |
## Error Handling
- If the input file is not found, an error message will be displayed.
- If the number of weights, impacts, or columns in the decision matrix is incorrect, a `ValueError` will be raised.
- If the columns from the 2nd to the last do not contain numeric values, a `ValueError` will be raised.
- Any unexpected errors during the execution will be displayed.
## LICENSE
(c) 2024 Himanshu Bansal
This project is licensed under the [MIT License](LICENSE).
Raw data
{
"_id": null,
"home_page": "",
"name": "Topsis-Himanshu-102103568",
"maintainer": "",
"docs_url": null,
"requires_python": "",
"maintainer_email": "",
"keywords": "Topsis,Topsis-Himanshu-102103568,Himanshu,Topsis-Himanshu,102103568",
"author": "Himanshu Bansal",
"author_email": "himu90505@gmail.com",
"download_url": "https://files.pythonhosted.org/packages/5e/e5/f92df4ff49b0f6b34d5ed4c4118b66952d37fc920d479a5a809928f1a5b9/Topsis-Himanshu-102103568-1.0.3.tar.gz",
"platform": null,
"description": "# Project Description\r\n- for: Assignment-1(UCS654)\r\n- Submitted by: Himanshu Bansal\r\n- Roll no: 102103568\r\n- Group: 3COE20\r\n\r\n# TOPSIS (Technique for Order of Preference by Similarity to Ideal Solution)\r\n\r\nThis Python script implements the TOPSIS method for multi-criteria decision-making. It takes a CSV file containing a decision matrix, weights, and impacts as input, and produces a ranked result based on the TOPSIS score.\r\n\r\n## Installation\r\n```bash\r\npip install Topsis-Himanshu-102103568\r\n```\r\n\r\n## Usage\r\n\r\n```bash\r\nfrom Topsis_Himanshu_102103568.topsis import topsis \r\ninputFile=\"sample.csv\"\r\nweights=\"1,1,1,1\"\r\nimpacts=\"-,+,+,+\"\r\nresultFile=\"result.csv\" \r\ntopsis(inputFile, weights, impacts, resultFile)\r\n```\r\n\r\nOR \r\n\r\nYou can use this package via command line as:\r\n```bash\r\npython -m Topsis_Himanshu_102103568.topsis [InputDataFile as .csv] [Weights as a string] [Impacts as a string] [ResultFileName as .csv]\r\n```\r\n\r\n- `InputDataFile`: Path to the CSV file containing the input data.\r\n- `Weights`: Comma-separated weights for each criterion.\r\n- `Impacts`: Comma-separated impact direction for each criterion (`+` for maximization, `-` for minimization).\r\n- `ResultFileName`: Name of the file to save the TOPSIS results.\r\n\r\n## Requirements\r\n\r\n- Python 3\r\n- pandas\r\n- numpy\r\n\r\n## Input File Format\r\nThe input data should be in a CSV format with the following structure:\r\n\r\n| Fund Name | P1 | P2 | P3 | P4 | P5 |\r\n|-----------|------|------|------|------|-------|\r\n| M1 | 0.84 | 0.71 | 6.7 | 42.1 | 12.59 |\r\n| M2 | 0.91 | 0.83 | 7 | 31.7 | 10.11 |\r\n| M3 | 0.79 | 0.62 | 4.8 | 46.7 | 13.23 |\r\n| M4 | 0.78 | 0.61 | 6.4 | 42.4 | 12.55 |\r\n| M5 | 0.94 | 0.88 | 3.6 | 62.2 | 16.91 |\r\n| M6 | 0.88 | 0.77 | 6.5 | 51.5 | 14.91 |\r\n| M7 | 0.66 | 0.44 | 5.3 | 48.9 | 13.83 |\r\n| M8 | 0.93 | 0.86 | 3.4 | 37 | 10.55 |\r\n\r\n\r\n## Output\r\n\r\nThe script generates a CSV file containing the TOPSIS score and rank for each object:\r\n\r\n| Fund Name | P1 | P2 | P3 | P4 | P5 | Topsis Score | Rank |\r\n|-----------|------|------|------|------|-------|----------------------|------|\r\n| M1 | 0.84 | 0.71 | 6.7 | 42.1 | 12.59 | 0.41855328299643013 | 7.0 |\r\n| M2 | 0.91 | 0.83 | 7.0 | 31.7 | 10.11 | 0.4663977143091959 | 5.0 |\r\n| M3 | 0.79 | 0.62 | 4.8 | 46.7 | 13.23 | 0.5374784843237046 | 3.0 |\r\n| M4 | 0.78 | 0.61 | 6.4 | 42.4 | 12.55 | 0.4295182212044884 | 6.0 |\r\n| M5 | 0.94 | 0.88 | 3.6 | 62.2 | 16.91 | 0.5453066145383307 | 2.0 |\r\n| M6 | 0.88 | 0.77 | 6.5 | 51.5 | 14.91 | 0.39814192807166954 | 8.0 |\r\n| M7 | 0.66 | 0.44 | 5.3 | 48.9 | 13.83 | 0.4743648907682155 | 4.0 |\r\n| M8 | 0.93 | 0.86 | 3.4 | 37.0 | 10.55 | 0.6392872727749049 | 1.0 |\r\n\r\n\r\n## Error Handling\r\n\r\n- If the input file is not found, an error message will be displayed.\r\n- If the number of weights, impacts, or columns in the decision matrix is incorrect, a `ValueError` will be raised.\r\n- If the columns from the 2nd to the last do not contain numeric values, a `ValueError` will be raised.\r\n- Any unexpected errors during the execution will be displayed.\r\n\r\n## LICENSE\r\n\r\n(c) 2024 Himanshu Bansal\r\n\r\nThis project is licensed under the [MIT License](LICENSE).\r\n",
"bugtrack_url": null,
"license": "MIT License",
"summary": "Implementation of Topsis",
"version": "1.0.3",
"project_urls": {
"Project Link": "https://github.com/himu23369/Topsis-Himanshu-102103568"
},
"split_keywords": [
"topsis",
"topsis-himanshu-102103568",
"himanshu",
"topsis-himanshu",
"102103568"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "ea7b947c8f9e74d61f55fc95fd80a306f47dd76ff98a70373c38f41be5142c1c",
"md5": "46b2ad64413ad26948b6dba6f71f3241",
"sha256": "7e473daa88ec2da2caae77f7092d369f42b1184133177d9c8da4e16e66e85652"
},
"downloads": -1,
"filename": "Topsis_Himanshu_102103568-1.0.3-py3-none-any.whl",
"has_sig": false,
"md5_digest": "46b2ad64413ad26948b6dba6f71f3241",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": null,
"size": 5139,
"upload_time": "2024-01-23T19:14:47",
"upload_time_iso_8601": "2024-01-23T19:14:47.827681Z",
"url": "https://files.pythonhosted.org/packages/ea/7b/947c8f9e74d61f55fc95fd80a306f47dd76ff98a70373c38f41be5142c1c/Topsis_Himanshu_102103568-1.0.3-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "5ee5f92df4ff49b0f6b34d5ed4c4118b66952d37fc920d479a5a809928f1a5b9",
"md5": "dfba7a7ffaaece68880367639eea727f",
"sha256": "545422ada9f437fca07116ca28245b51fb00922d88f8d498e39d652ae728e498"
},
"downloads": -1,
"filename": "Topsis-Himanshu-102103568-1.0.3.tar.gz",
"has_sig": false,
"md5_digest": "dfba7a7ffaaece68880367639eea727f",
"packagetype": "sdist",
"python_version": "source",
"requires_python": null,
"size": 4689,
"upload_time": "2024-01-23T19:14:50",
"upload_time_iso_8601": "2024-01-23T19:14:50.836528Z",
"url": "https://files.pythonhosted.org/packages/5e/e5/f92df4ff49b0f6b34d5ed4c4118b66952d37fc920d479a5a809928f1a5b9/Topsis-Himanshu-102103568-1.0.3.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-01-23 19:14:50",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "himu23369",
"github_project": "Topsis-Himanshu-102103568",
"travis_ci": false,
"coveralls": false,
"github_actions": false,
"lcname": "topsis-himanshu-102103568"
}