Python Exam Summary Notes
1. Data Visualization
Data visualization is the graphical representation of information using plots and charts to identify patterns and
insights. Libraries: matplotlib, seaborn.
2. Matplotlib Plotting
Matplotlib is used for plotting line charts, bar graphs, histograms, etc. Example: plt.plot(x, y), plt.show().
3. Seaborn Plots (Box, Violin, Heatmap)
Box Plot shows distribution; Violin Plot combines box and KDE; Heatmap displays matrix-like data.
4. Differences: Seaborn vs Matplotlib
Seaborn offers prettier, high-level plots. Matplotlib provides full control and flexibility.
5. Histogram in Matplotlib
Histogram shows distribution of data values in bins. Example: plt.hist(data, bins=5).
6. Violin Plot
Displays distribution and density of data. Example: sns.violinplot(x='day', y='total_bill', data=df).
7. Scatter Plot
Shows relation between 2 variables using dots. Example: plt.scatter(x, y).
8. Subplot in Matplotlib
Allows plotting multiple graphs in one figure using plt.subplot().
9. Bar Chart
Represents categorical data using bars. Example: plt.bar(categories, values).
10. Scatter Plot Customization
Python Exam Summary Notes
Customize with color, size, marker shape. Example: marker='*', color='red'.
11. Filling Missing Values
Use mean, median, or mode to fill nulls. Example: df.fillna(df.mean()).
12. Normalization & Standardization
Normalization rescales to [0,1], Standardization gives mean 0 and std 1.
13. Types of Joins
Inner, Left, Right, Outer joins combine datasets based on keys.
14. Normalization
Transforms features to scale between 0 and 1. Use MinMaxScaler.
15. Looping in Databases
Use cursor to fetch and loop through rows in SQLite/MySQL.
16. Categorical Data Preprocessing
Convert non-numeric data using label or one-hot encoding.
17. Merging & Joining
Combine datasets with pd.merge(). Can specify join types.
18. Categorical Data (101)
Types: Nominal (no order), Ordinal (ordered). Encode before ML.
19. Encoding Methods
Label, One-hot, and Ordinal Encoding transform text to numbers.