Python Programming Examples
Unlike the SAS course materials on CodeHurry, which are organized into structured lessons, this Python section provides a limited collection of project-based code examples, along with several Python scripts covering Python basics and data analysis activities. It is intended as a practical programming reference for researchers, analysts, and programmers working with Python applications, rather than as a formal Python training course.
Covers print(), range(), enumerate(),
user-defined functions, key Python language concepts, and Path methods.
Analyzes U.S. state population data using Python and pandas.
Open Jupyter NotebookCovers lookup, transformation, duplicate removal, and dataset comparison.
Open Jupyter Notebook
Demonstrates folder navigation, file searching, and directory traversal in Python
using the os pathlib modules.
Demonstrates selected Pandas functions.
Open Jupyter Notebook
Automates finding and copying all index.html files
from multiple subdirectories into a single directory, prefixing
each copied file with its original folder name.
Combines multiple CSV files, removes duplicate links, sorts the dataset, and generates cleaned Excel and HTML outputs with clickable hyperlinks.
View Code Code DescriptionCombines multiple Excel worksheets into a single pandas DataFrame and exports the data as a SAS dataset.
View Code Code DescriptionUses a rule-based system to categorize records involving violence against religious minorities in Bangladesh.
View CodeDefines category keywords and weights for classifying and scoring YouTube videos related to violence against religious minorities in Bangladesh.
View Code
Defines SEARCH_QUERIES, a collection of YouTube search phrases for identifying
videos related to violence against religious minorities in Bangladesh.
Searches YouTube, classifies videos, and generates reports on violence against religious minorities in Bangladesh.
View CodeCreates a horizontal bar chart with Matplotlib to visualize incident frequencies by category.
View Code Code DescriptionCreates a stacked chart with Matplotlib to visualize population counts by religion across census years.
View Code Code DescriptionAnalyzes YouTube video publication years, displays the frequency distribution, and exports the results to a text file.
View Code Code DescriptionAudits Python installations, environments, PATH settings, and Conda configuration on the computer.
View Code Code Description View OutputThe Python programming materials provided on this website are intended for educational and reference purposes only. The author assumes no responsibility for errors, omissions, or consequences resulting from the use of these materials. Users should independently verify program logic, analytical assumptions, and results before applying these examples to their own research or production analyses.
Python® is a registered trademark of the Python Software Foundation. CodeHurry is not affiliated with, endorsed by, or sponsored by the Python Software Foundation. Python-related programming examples on this website are provided solely for educational and reference purposes.