UNIT 5 - Python Notes
Python Packages
Python packages are collections of modules used to perform specific tasks. Common packages include NumPy,
Pandas, and Matplotlib.
NumPy
NumPy is used for numerical operations and arrays.
Example:
import numpy as np
a = [Link]([1,2,3])
Pandas
Pandas is used for data analysis and tables (DataFrames).
Example:
import pandas as pd
data = {'Name':['A','B'], 'Marks':[90,85]}
Matplotlib
Matplotlib is used for plotting graphs and charts.
Example:
import [Link] as plt
[Link]([1,2,3],[4,5,6])
GUI Programming
GUI stands for Graphical User Interface. Python provides Tkinter for creating GUI applications.
Tkinter Introduction
Tkinter is the standard GUI library in Python. It helps create windows, buttons, labels, and text boxes.
Basic Tkinter Program
Example:
from tkinter import *
root = Tk()
[Link]('My App')
[Link]()
Tk Widgets
Common Tkinter widgets:
1. Label - Displays text
2. Button - Creates a button
3. Entry - Input field
4. Text - Multi-line text
Python IDE
IDE means Integrated Development Environment. Popular Python IDEs are IDLE, PyCharm, VS Code, and Jupyter
Notebook.
Important Package Summary
Package Use
NumPy Numerical Operations
Pandas Data Analysis
Matplotlib Graphs and Charts
Tkinter GUI Applications