Skip to main content

29 docs tagged with "Python"

Python language notes.

View all tags

Arrays and Attributes

Creating ndarrays, the six shape attributes, dtypes, and why an array is not a list.

Choosing a Chart

Every chart type answers one specific question — pick the chart by starting from the question.

Cleaning Data

Filling and dropping missing values, removing duplicates, and converting types back after the fix.

Conditional Statements

if, if/else, if/elif/else, nested conditions, and the logical operators that combine them.

Correlation and Covariance

Measuring whether two variables move together — the correlation scale, why covariance can't be compared, and what correlation misses.

Data Types

Python's four scalar and four collection types — int, float, str, bool, list, tuple, dict, set.

Descriptive Statistics

Mean, median, mode, range, variance, standard deviation and quartiles — what each one tells you and when it misleads.

Dictionaries and Sets

Key/value lookup with dict, uniqueness and set algebra with set, and why keys must be immutable.

F-Strings

Formatted string literals — format specs, alignment, padding, conversion flags, and debug mode.

Input and Output

input() always returns a string, and print() has three parameters worth knowing — sep, end, and the values themselves.

Inspecting Data

head, tail, shape, dtypes, info and describe — the first six things to run on any new DataFrame.

Lists

The mutable sequence — methods that change it in place, sort vs sorted, the reference trap, and comprehensions.

Loops

for and while loops, range(), break and continue, the loop else clause, and nested loops.

Matplotlib

Line, bar, histogram, scatter and pie charts with pyplot — plus figure, show and savefig.

Operations and Broadcasting

Element-wise arithmetic, the broadcasting rules, universal functions, matrix multiplication, sorting and stacking.

Plotly

Interactive charts with plotly.express — hover, zoom and pan, plus bubble charts and how to export.

Python

Python notes from Fundamentals of AI — basics through NumPy, Pandas, and visualisation.

Seaborn

Statistical charts in one line — bar, count, histogram, scatter, box, violin, heatmap and pair plot.

Series and DataFrames

The two pandas structures — a labelled 1-D Series and a 2-D DataFrame — and how the index changes everything.

Strings and Slicing

Indexing, the three-part slice, immutability, and the string methods worth knowing.

Tuples

The immutable sequence — the trailing-comma rule, shallow immutability, unpacking, and when a tuple beats a list.

Values and Types

Every Python value carries its type. How to ask what that type is, and what happens when you convert between them.

Variables and Naming

What makes a Python identifier legal, the 35 reserved keywords, and the PEP 8 conventions on top.