├── .gitignore ├── PProject.py ├── Provisional_COVID-19_Deaths_by_Sex_and_Age .xlsx └── README.md /.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 | -------------------------------------------------------------------------------- /PProject.py: -------------------------------------------------------------------------------- 1 | import pandas as pd 2 | import matplotlib.pyplot as plt 3 | 4 | # Load the CSV file 5 | df = pd.read_csv("Provisional_COVID-19_Deaths_by_Sex_and_Age .csv") 6 | print(df.head()) 7 | print(df.info()) 8 | 9 | # Summary Statistics 10 | print("Summary Statistics:") 11 | print(df.describe()) 12 | 13 | #Handling Missing Data 14 | df_cleaned = df.dropna(subset=['Year']) 15 | 16 | # OBJECTIVE 1: Age-wise COVID-19 Deaths 17 | age_data = df.groupby("Age Group")["COVID-19 Deaths"].sum().dropna() 18 | plt.bar(age_data.index, age_data.values, color='skyblue') 19 | plt.title("COVID-19 Deaths by Age Group") 20 | plt.xlabel("Age Group") 21 | plt.ylabel("Total Deaths") 22 | plt.xticks(rotation=90) 23 | plt.show() 24 | 25 | # OBJECTIVE 2: Trend of COVID-19, Pneumonia, and Influenza Deaths 26 | df2 = df.dropna(subset=['Year']) 27 | data = df2.groupby("Year")[["COVID-19 Deaths", "Pneumonia Deaths", "Influenza Deaths"]].sum() 28 | plt.plot(data.index, data["COVID-19 Deaths"], 'r*-', label="COVID-19") 29 | plt.plot(data.index, data["Pneumonia Deaths"], 'go--', label="Pneumonia") 30 | plt.plot(data.index, data["Influenza Deaths"], 'bs-.', label="Influenza") 31 | plt.title("Yearly Deaths: COVID-19 vs Pneumonia vs Influenza") 32 | plt.xlabel("Year") 33 | plt.ylabel("Number of Deaths") 34 | plt.legend() 35 | plt.grid(True) 36 | plt.show() 37 | 38 | # OBJECTIVE 3: Year-wise COVID-19 Deaths 39 | df_clean = df.dropna(subset=["Year"]) 40 | yearly_deaths = df_clean.groupby("Year")["COVID-19 Deaths"].sum() 41 | plt.bar(yearly_deaths.index.astype(str), yearly_deaths.values, color='skyblue') 42 | plt.title("Year-wise COVID-19 Deaths") 43 | plt.xlabel("Year") 44 | plt.ylabel("Total Deaths") 45 | plt.grid(axis='y') 46 | plt.show() 47 | 48 | # OBJECTIVE 4: Gender-wise COVID-19 Deaths 49 | gender_deaths = df.groupby("Sex")["COVID-19 Deaths"].sum().dropna() 50 | plt.pie(gender_deaths.values, labels=gender_deaths.index, autopct='%1.1f%%', startangle=90, colors=['lightcoral', 'lightskyblue', 'lightgreen']) 51 | plt.title("Gender-wise Distribution of COVID-19 Deaths") 52 | plt.axis('equal') # Equal aspect ratio for a perfect circle 53 | plt.show() 54 | 55 | # OBJECTIVE 5: State-wise COVID-19 Deaths (Top 20) 56 | state = df.groupby("State")["COVID-19 Deaths"].sum().dropna().sort_values(ascending=False).head(20) 57 | plt.figure(figsize=(10,5)) 58 | plt.bar(state.index, state.values, color='teal') 59 | plt.title("Top 20 US States by COVID-19 Deaths") 60 | plt.xlabel("State") 61 | plt.ylabel("Total Deaths") 62 | plt.xticks(rotation=90) 63 | plt.tight_layout() 64 | plt.show() 65 | -------------------------------------------------------------------------------- /Provisional_COVID-19_Deaths_by_Sex_and_Age .xlsx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KavitaSinghPanwar/PythonProject/7213828d08379fcdde82f5b7c0c11b36f6e5703f/Provisional_COVID-19_Deaths_by_Sex_and_Age .xlsx -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # PythonProject --------------------------------------------------------------------------------