Skip to content
Learn Netverks

Lesson

Step 18/36 50% through track

scipy-linalg-basics

SciPy linalg basics

Last reviewed Jun 1, 2026 Content v20260601
Track mode
server_script
Means
Server runner
Reading
~1 min
Level
beginner

This lesson

This lesson teaches SciPy linalg basics: SciPy scientific routines on NumPy arrays—statistics, optimization, linear algebra, and numerical methods.

Teams apply SciPy linalg basics in every serious SciPy project—skipping it leaves blind spots in analysis and reviews.

You will apply SciPy linalg basics in contexts like: Scientific computing, recommender systems, and large sparse feature pipelines.

Read the narrative, run NumPy + SciPy snippets in the playground (install scipy and numpy with pip if needed), inspect outputs and convergence, and complete MCQs.

When you can explain the previous lesson's ideas in your own words.

scipy.linalg extends NumPy linear algebra with decompositions (LU, QR, Cholesky), matrix functions, and numerically stable solvers for dense problems.

When scipy.linalg vs np.linalg

  • Small solves: either np.linalg.solve or linalg.solve
  • Decompositions: linalg.lu, linalg.qr, linalg.cholesky
  • Matrix exponentials, norms, determinants with LAPACK backends

Array dtypes

Use float64 for stability unless memory forces float32. Ill-conditioned matrices need condition number checks via linalg.cond.

Norm and det

import numpy as np
from scipy import linalg

A = np.array([[1., 2.], [3., 4.]])
print('det:', linalg.det(A))
print('norm:', linalg.norm(A))
print('cond:', linalg.cond(A))

Important interview questions and answers

  1. Q: Condition number?
    A: Ratio relating input perturbation to output error—large cond means unstable solve.
  2. Q: Why float64?
    A: Single precision can fail subtle LA tasks; production numerics often default to double.

Self-check

  1. Name three scipy.linalg capabilities beyond np.linalg.solve.
  2. What does a large condition number warn you about?

Tip: Check linalg.cond(A) before trusting solves on nearly singular matrices.

Interview prep

cond(A)?

Condition number—large means unstable solves.

float64?

Default for stable dense linear algebra.

Interview tip Lesson completion confidence

Can you explain this lesson in 30 seconds without reading notes?

Not saved yet.

Playground

Runs on the configured server runner (dev: npm run runner with LEARNING_RUNNER_ENABLED=true). Output appears below the editor.

Check yourself

Multiple choice — immediate feedback.

Discussion

Past discussion is visible to everyone. Only logged-in users can post comments and replies.

Starter discussion topics

  • vs numpy.linalg?
  • When scipy.linalg?

Sign up or log in to post comments and sync lesson progress across devices.

No discussion yet. Be the first to ask a question.

Jump