Study Atlas › Computer Science › Programming

Python programming essentials

A readable, general-purpose language widely used in data science, web development, automation and AI.

Edited by Alex C, EduAlx · Sources cited below

Explanation

Created by Guido van Rossum (first released 1991). Features: dynamic typing, indentation-based blocks, lists, dictionaries, comprehensions, functions as objects and a huge standard library. NumPy, pandas, scikit-learn and PyTorch make it the leading language for data and AI.

Example

Reading a CSV and summarising sales by region in pandas takes a few lines.

Code

import pandas as pd
df = pd.read_csv('sales.csv')
print(df.groupby('region')['amount'].sum().sort_values(ascending=False))

How it works, step by step

  1. Write code in .py files or notebooks
  2. Interpreter compiles to bytecode
  3. Bytecode runs on the Python VM
  4. Libraries extend capabilities

Open the interactive page with diagrams →

People behind it

References

  1. G. van Rossum, F. L. Drake, The Python Language Reference, Python Software Foundation (docs.python.org).

Textbooks

Related topics

RecursionTesting and debuggingClustering and unsupervised learningHuman–computer interaction and usabilityDecision trees and ensemble methodsError-detecting and error-correcting codesReinforcement learningAlgorithms and Big-O complexityNatural language processingSorting algorithms (quicksort, mergesort, heapsort)