├── .gitignore ├── 12322927pythonproject.zip ├── README.md ├── excelprojectdata.csv └── python project kunal.py /.gitignore: -------------------------------------------------------------------------------- 1 | # Byte-compiled / optimized / DLL files 2 | __pycache__/ 3 | *.py[cod] 4 | *$py.class 5 | 6 | # C extensions 7 | *.so 8 | 9 | # Distribution / packaging 10 | .Python 11 | build/ 12 | develop-eggs/ 13 | dist/ 14 | downloads/ 15 | eggs/ 16 | .eggs/ 17 | lib/ 18 | lib64/ 19 | parts/ 20 | sdist/ 21 | var/ 22 | wheels/ 23 | share/python-wheels/ 24 | *.egg-info/ 25 | .installed.cfg 26 | *.egg 27 | MANIFEST 28 | 29 | # PyInstaller 30 | # Usually these files are written by a python script from a template 31 | # before PyInstaller builds the exe, so as to inject date/other infos into it. 32 | *.manifest 33 | *.spec 34 | 35 | # Installer logs 36 | pip-log.txt 37 | pip-delete-this-directory.txt 38 | 39 | # Unit test / coverage reports 40 | htmlcov/ 41 | .tox/ 42 | .nox/ 43 | .coverage 44 | .coverage.* 45 | .cache 46 | nosetests.xml 47 | coverage.xml 48 | *.cover 49 | *.py,cover 50 | .hypothesis/ 51 | .pytest_cache/ 52 | cover/ 53 | 54 | # Translations 55 | *.mo 56 | *.pot 57 | 58 | # Django stuff: 59 | *.log 60 | local_settings.py 61 | db.sqlite3 62 | db.sqlite3-journal 63 | 64 | # Flask stuff: 65 | instance/ 66 | .webassets-cache 67 | 68 | # Scrapy stuff: 69 | .scrapy 70 | 71 | # Sphinx documentation 72 | docs/_build/ 73 | 74 | # PyBuilder 75 | .pybuilder/ 76 | target/ 77 | 78 | # Jupyter Notebook 79 | .ipynb_checkpoints 80 | 81 | # IPython 82 | profile_default/ 83 | ipython_config.py 84 | 85 | # pyenv 86 | # For a library or package, you might want to ignore these files since the code is 87 | # intended to run in multiple environments; otherwise, check them in: 88 | # .python-version 89 | 90 | # pipenv 91 | # According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control. 92 | # However, in case of collaboration, if having platform-specific dependencies or dependencies 93 | # having no cross-platform support, pipenv may install dependencies that don't work, or not 94 | # install all needed dependencies. 95 | #Pipfile.lock 96 | 97 | # UV 98 | # Similar to Pipfile.lock, it is generally recommended to include uv.lock in version control. 99 | # This is especially recommended for binary packages to ensure reproducibility, and is more 100 | # commonly ignored for libraries. 101 | #uv.lock 102 | 103 | # poetry 104 | # Similar to Pipfile.lock, it is generally recommended to include poetry.lock in version control. 105 | # This is especially recommended for binary packages to ensure reproducibility, and is more 106 | # commonly ignored for libraries. 107 | # https://python-poetry.org/docs/basic-usage/#commit-your-poetrylock-file-to-version-control 108 | #poetry.lock 109 | 110 | # pdm 111 | # Similar to Pipfile.lock, it is generally recommended to include pdm.lock in version control. 112 | #pdm.lock 113 | # pdm stores project-wide configurations in .pdm.toml, but it is recommended to not include it 114 | # in version control. 115 | # https://pdm.fming.dev/latest/usage/project/#working-with-version-control 116 | .pdm.toml 117 | .pdm-python 118 | .pdm-build/ 119 | 120 | # PEP 582; used by e.g. github.com/David-OConnor/pyflow and github.com/pdm-project/pdm 121 | __pypackages__/ 122 | 123 | # Celery stuff 124 | celerybeat-schedule 125 | celerybeat.pid 126 | 127 | # SageMath parsed files 128 | *.sage.py 129 | 130 | # Environments 131 | .env 132 | .venv 133 | env/ 134 | venv/ 135 | ENV/ 136 | env.bak/ 137 | venv.bak/ 138 | 139 | # Spyder project settings 140 | .spyderproject 141 | .spyproject 142 | 143 | # Rope project settings 144 | .ropeproject 145 | 146 | # mkdocs documentation 147 | /site 148 | 149 | # mypy 150 | .mypy_cache/ 151 | .dmypy.json 152 | dmypy.json 153 | 154 | # Pyre type checker 155 | .pyre/ 156 | 157 | # pytype static type analyzer 158 | .pytype/ 159 | 160 | # Cython debug symbols 161 | cython_debug/ 162 | 163 | # PyCharm 164 | # JetBrains specific template is maintained in a separate JetBrains.gitignore that can 165 | # be found at https://github.com/github/gitignore/blob/main/Global/JetBrains.gitignore 166 | # and can be added to the global gitignore or merged into this file. For a more nuclear 167 | # option (not recommended) you can uncomment the following to ignore the entire idea folder. 168 | #.idea/ 169 | 170 | # Ruff stuff: 171 | .ruff_cache/ 172 | 173 | # PyPI configuration file 174 | .pypirc 175 | -------------------------------------------------------------------------------- /12322927pythonproject.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/APkunal12/DataAnalysisByPython/aceb1530403167a06be4f7f0a779ff56245b41be/12322927pythonproject.zip -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # DataAnalysisByPython -------------------------------------------------------------------------------- /python project kunal.py: -------------------------------------------------------------------------------- 1 | import pandas as pd 2 | import numpy as np 3 | import matplotlib.pyplot as plt 4 | import seaborn as sns 5 | 6 | # Load dataset 7 | file_path = "C:\\Users\\TANISH\\Downloads\\12322927-pythonproject\\excelprojectdata.csv" 8 | df = pd.read_csv(file_path) 9 | 10 | # Handling missing values 11 | df.fillna(0, inplace=True) 12 | 13 | # Summary Statistics 14 | print("Summary Statistics:") 15 | print(df.describe()) 16 | 17 | # 1. Total Beneficiaries by State 18 | if "state_name" in df.columns and "total_beneficiaries" in df.columns: 19 | statewise_beneficiaries = df.groupby("state_name")["total_beneficiaries"].sum().reset_index() 20 | print("\nTotal Beneficiaries by State:") 21 | print(statewise_beneficiaries) 22 | else: 23 | print("Columns 'state_name' or 'total_beneficiaries' not found in dataset.") 24 | 25 | # 2. Distribution of Beneficiaries 26 | if "total_beneficiaries" in df.columns: 27 | plt.figure(figsize=(10, 5)) 28 | sns.histplot(df["total_beneficiaries"], bins=30, kde=True) 29 | plt.title("Distribution of Total Beneficiaries") 30 | plt.xlabel("Total Beneficiaries") 31 | plt.ylabel("Frequency") 32 | plt.show() 33 | else: 34 | print("Column 'total_beneficiaries' not found in dataset.") 35 | 36 | # 3. Aadhar vs Mobile Number Correlation 37 | if "total_aadhar" in df.columns and "total_mobileno" in df.columns: 38 | plt.figure(figsize=(6, 6)) 39 | sns.scatterplot(x=df["total_aadhar"], y=df["total_mobileno"], alpha=0.6) 40 | plt.title("Correlation between Aadhar and Mobile-linked Beneficiaries") 41 | plt.xlabel("Total Aadhar") 42 | plt.ylabel("Total Mobile Numbers") 43 | plt.show() 44 | else: 45 | print("Columns 'total_aadhar' or 'total_mobileno' not found in dataset.") 46 | 47 | # 4. Beneficiary Breakdown by Category 48 | beneficiary_categories = ["total_sc", "total_st", "total_gen", "total_obc"] 49 | available_categories = [col for col in beneficiary_categories if col in df.columns] 50 | if available_categories: 51 | df[available_categories].sum().plot(kind="bar", figsize=(8,5), color=['blue', 'green', 'red', 'purple']) 52 | plt.title("Beneficiary Breakdown by Category") 53 | plt.xlabel("Category") 54 | plt.ylabel("Total Count") 55 | plt.xticks(rotation=0) 56 | plt.show() 57 | else: 58 | print("None of the category columns found in dataset.") 59 | 60 | # 5. State-wise Average Beneficiaries 61 | if "state_name" in df.columns and "total_beneficiaries" in df.columns: 62 | statewise_avg = df.groupby("state_name")["total_beneficiaries"].mean().reset_index() 63 | plt.figure(figsize=(12, 6)) 64 | sns.barplot(y="state_name", x="total_beneficiaries", hue="state_name", data=statewise_avg, dodge=False, legend=False, palette="magma") 65 | plt.title("State-wise Average Beneficiaries") 66 | plt.xlabel("Average Beneficiaries") 67 | plt.ylabel("State Name") 68 | plt.show() 69 | else: 70 | print("Columns 'state_name' or 'total_beneficiaries' not found in dataset.") 71 | --------------------------------------------------------------------------------