Python Tutorials

Articles

Mastering Python Libraries for Messy Datasets
Advanced String Manipulation Techniques in Python
Python Unit Testing: Writing Code to Test Your Own Code

Simple Exercises

Find the Max value in a Python List without using the max function
Find the Min value in a Python List without using the min function
Count the Number of Characters in a String in Python (without using the len function)
How to Reverse a String in Python
Count the Number of Spaces in a String in Python
Count Vowels in a String in Python
Count Consonants in a String in Python
Count the number of times a character appears in a string in Python
Find the Middle Item in a Python List

Functions and Methods

enumerate()
range()
split()
join()
pop()
reversed()

Matplotlib

Create Charts – Matplotlib
Export Matplotlib Charts to PDF
Plot Histogram
Pie Chart using Matplotlib
Line Chart using Matplotlib
Scatter Diagram using Matplotlib
Bar Chart using Matplotlib
Horizontal Bar Chart using Matplotlib

Pandas

Calculate stats
Import CSV File into Python
Import CSV with Variable Name
Import Excel File into Python
Create Pandas DataFrame
Export DataFrame to CSV
Export DataFrame to Excel
Export DataFrame to JSON
IF condition – DataFrame

Concatenate Column Values
Convert DataFrame to List

Sort Pandas DataFrame
Create Pivot Table
Remove Duplicates from Pandas DataFrame
Select Rows from Pandas DataFrame
Union Pandas DataFrames
Plot DataFrame
Descriptive Statistics for Pandas DataFrame
Convert Strings to Floats in Pandas DataFrame
LEFT, RIGHT and MID in Pandas
Replace NaN Values with Zeros
Load JSON String into DataFrame
Round Values in Pandas DataFrame
Count Duplicates in Pandas DataFrame
Sum each Column and Row in Pandas DataFrame
Assign new column to Pandas DataFrame
Compare Values between two DataFrames
Join Pandas DataFrames using Merge
Convert Strings to Integers in Pandas DataFrame
Convert a List to DataFrame
Reset an Index in Pandas DataFrame
Rename Columns in Pandas DataFrame
Drop Rows with NaN Values in Pandas DataFrame
Pandas DataFrame to SQL
Convert CSV to Excel
Convert Integers to Floats in Pandas DataFrame
Correlation Matrix using Pandas
Average each Column and Row in Pandas DataFrame
Convert Dictionary to Pandas DataFrame
Convert Excel to CSV
Covariance Matrix
Convert JSON String to CSV
Data Type in Pandas DataFrame
Convert Integers to Strings in Pandas DataFrame
Convert CSV to JSON String
Convert Text File to CSV
Generate Random Integers in Pandas Dataframe
Check for NaN in Pandas DataFrame
Fastest way to Convert Integers to Strings
Check the Version of Pandas Installed
Convert Strings to Datetime in Pandas DataFrame
Create NaN Values in Pandas DataFrame
Change the Pandas Version in Windows
Replace Values in Pandas DataFrame
Create Pandas Series from a List
Convert Pandas Series to a DataFrame
Set Column as Index in Pandas DataFrame
Convert Integers to Datetime in Pandas DataFrame
Get a List of All Column Names in Pandas DataFrame
Convert Index to Column in Pandas DataFrame
Select Rows Containing a Substring in Pandas DataFrame
Change Strings to Lowercase in Pandas DataFrame
Change Strings to Uppercase in Pandas DataFrame
Add Prefix to Each Column Name in Pandas DataFrame
Add Suffix to Each Column Name in Pandas DataFrame
Randomly Select Rows from Pandas DataFrame
Randomly Select Columns from Pandas DataFrame
Drop Columns from Pandas DataFrame
Drop Rows by Index in Pandas DataFrame
Sort an Index in Pandas DataFrame
Check if a Pandas DataFrame is Empty
Filter Pandas DataFrame Based on Index
Select all Rows with NaN Values in Pandas DataFrame
Convert Pandas DataFrame to NumPy Array
Convert NumPy Array to Pandas DataFrame
Replace Characters in Strings in Pandas DataFrame
Transpose Pandas DataFrame
Find all Columns with NaN Values in Pandas DataFrame
Change the Order of Columns in Pandas DataFrame
Convert Pandas DataFrame to a Series
Convert Pandas DataFrame to a Dictionary
Convert Floats to Integers in Pandas DataFrame
Convert Floats to Strings in Pandas DataFrame
Drop Columns with NaN Values in Pandas DataFrame
Count NaN values in Pandas DataFrame
Convert JSON String to TEXT File
Get the first N rows in Pandas DataFrame
Sort Pandas Series
Remove the First Rows in Pandas DataFrame
Export Pandas Series to a CSV File
Convert Pandas DataFrame to HTML Table
Convert DataFrame Column Values to Absolute Values

Convert String to Pandas DataFrame
Filter Rows in Pandas DataFrame using RegEx
Convert JSON to Excel using Python
Convert Excel File to JSON using Python

Machine Learning

Linear Regression – statsmodels
Multiple Linear Regression
K-Means Clustering
Confusion Matrix

Databases & SQL

Connect Python to MS Access
Connect Python to Oracle
Connect Python to SQL Server

Create a Database using sqlite3
Use SQL in Python
Insert Values into SQL Server

SQL to Pandas DataFrame
Update Records in SQL Server
Import a CSV File to SQL Server using Python
Create Table in SQL Server using Python
Drop a Table in SQL Server using Python
Export SQL Server Table to CSV using Python
Delete Records in SQL Server using Python

GUI – tkinter

Create GUI – tkinter
Yes/No message box
Place charts on GUI
Create an Entry Box

System, Installations and Upgrades

Install package – PIP
Install package – Anaconda

Install package – connection error
Uninstall package – PIP
Upgrade PIP – Anaconda
Upgrade PIP – Windows
System Dates

Current Date
Delete File or Folder
Rename a File using Python
Schedule Python Script using Windows Scheduler
Add Python to Windows Path
Create Executable using Pyinstaller
List all txt Files in a Directory
Take Screenshots using Python
Convert Images to PDF using Python
Install Python on Windows
Copy File in Python
Move a File or Directory in Python
Create Progress Bar in Python
Time Delay in Python
Get all the Modules Installed in Python
Run One Python Script From Another
Measure the Time it Takes to Run Python Script
Screenshot to PDF using Python
Find Where Python is Installed on Windows
Control a Mouse using Python
Control a Keyboard using Python
Check the Version of the Python Interpreter
Check if a File or Directory Exists using Python
Get the Modified Time of a File using Python
Get the Latest File in a Folder using Python
Extract the File Extension using Python
Get the File Size using Python

Check the PIP Version on Windows
Create Executable using cx_Freeze
How to Use Poetry to Install Python Packages
Change the Version of PIP on Windows
Create Parametrized Pytest Tests for a Function in Python
Install the Pandas Package in Python
Use Configparser to Extract Values from an INI File
Install the NumPy Package in Python
Solve PIP is Not Recognized as an Internal or External Command
Fix the Unicodeescape Error
Install the Matplotlib Package
Resize an Image in Python
Use Python to get the File Paths within a Folder
Append Data to an Existing File using Python
Delete a File using Python

Other

While Loop
IF, ELIF and ELSE
Concatenate Lists
Create a Calculator using Python
Create a List in Python
Modify a List in Python
Append an Item to a List in Python
Convert JPG to PNG using Python
Convert PNG to JPG using Python
Sort a List in Python
Input function in Python
How to Check the Version of Numpy Installed
For Loop in Python
How to Check the Scikit-Learn Version Installed
Generate Random Numbers in a Python List
Concatenate Two Lists in Python
Convert Strings to Integers in a Python List
Write a String to a Text File using Python
Replace Items in a Python List
Count the Number of Elements in a Python List
Convert NumPy Array to a List in Python
Convert Python List to a NumPy Array
Extract Dictionary Keys as a List
Create a Dictionary in Python
Convert two Lists into a Dictionary
Extract Dictionary Values as a List
Remove Empty Strings from a List
Flatten a List of Lists
Iterate over two Lists simultaneously
Iterate over a Dictionary in Python
Iterate over a List of Lists in Python
Convert List to String in Python
Convert String to List in Python
Replace All Instances of Characters in a String
Count the Number of Times an Item Appears in a List
Convert Tuple to List in Python
Convert a List to a Tuple in Python
Convert All Items in a Python List to Lower Case

Convert All Elements in a Python List to Upper Case
Title Case – Python List
Capitalize – Python List
Convert String to Dictionary in Python
Convert Dictionary to String in Python
Convert Tuple to String in Python
Convert String to Tuple in Python
Count the Number of Keys in a Dictionary in Python
Write List of Lists to CSV File in Python
Write data to JSON file using Python
Check if a Substring Exists in a String in Python
Access and Modify Excel Files
Schedule Task Python
Read JSON Files
Text to PDF
Filter Python List Based on Conditions
Import numpy as np – Getting Started with NumPy
Import pandas as pd – Getting Started with Pandas
Count Duplicates in a Python List
Remove Duplicates from a Python List
Sort a List in Python
Sort a Dictionary in Python by Keys
Count Duplicates in a Python String