6. NumPy
Examples (24)
- E6.1A "comb" Function
- E6.2Creating a Magic Square
- E6.3vstack and hstack
- E6.4Checking a Sudoku grid for validity
- E6.5argmax and argmin
- E6.6Using NumPy's loadtxt method
- E6.7The Stroop effect
- E6.8Simulating radioactive decay
- E6.9Covariance with np.cov
- E6.10The correlation between air pressure and temperature
- E6.11The height of liquid in a spherical tank
- E6.12Finding a best-fit straight line
- E6.13Creating a rotation matrix in NumPy
- E6.14Mesh analysis of a electrical network
- E6.15Matrix operations
- E6.16Visualizing linear transformations
- E6.17Fitting the Beer-Lambert law with NumPy
- E6.18Random sampling of evenly-spaced real numbers
- E6.19Simulating coin-tosses
- E6.20The normal distribution
- E6.21Modelling the distribution of \(\mathrm{^{13}C}\) atoms in \(\mathrm{C_{60}}\)
- E6.22The probability of cleaving DNA with EcoRI
- E6.23Blurring an image with a two-dimensional FFT
- E6.24\(k\)-means clustering
Questions (20)
- Q6.1.1np.ndarray and np.array
- Q6.1.2Creating a NumPy array #1
- Q6.1.3Creating a NumPy array #2
- Q6.1.4Changing the data type of an array
- Q6.1.5Indexing and slicing a NumPy array
- Q6.1.6Boolean indexing
- Q6.1.7Using np.isclose #1
- Q6.1.8Using np.isclose #2
- Q6.1.9Verifying a magic square
- Q6.1.10Determining if an array is monotonically increasing
- Q6.1.11The dtypes of scalars and arrays
- Q6.4.1Derivative of a polynomial
- Q6.4.2Classifying the stationary points of a polynomial
- Q6.5.1The unitary property of the Pauli matrices
- Q6.5.2Fitting data to a quadratic function
- Q6.6.1Using np.random.randint
- Q6.6.2Using np.random.randint to sample from a set of evenly-spaced reals
- Q6.6.3The Mega Millions lottery
- Q6.6.4Probability of misprints
- Q6.7.1Direct implementation of the discrete Fourier Transform
Problems (32)
- P6.1.1A structured array of whale species data
- P6.1.2The shoelace algorithm
- P6.1.3Gaussian functions and their derivatives
- P6.2.18000 m peaks
- P6.2.2Airport distances
- P6.2.3Immunization rates
- P6.3.1Analysing lottery results
- P6.3.2Plotting a histogram with pyplot.bar
- P6.3.3Plotting a height distribution histogram
- P6.4.1Analysis of a nuclear explosion
- P6.4.2Linear Regression on four data sets
- P6.4.3The van der Waals equation of state
- P6.4.4Saturn V first stage launch analysis
- P6.5.1Planck units of measurement
- P6.5.2The moment of inertia tensor
- P6.5.3Singular value decomposition
- P6.5.4Finding the number of integers not containing the digit 5
- P6.5.5The Fibonacci sequence by matrix similarity transform
- P6.5.6Conic sections
- P6.5.7Radioactive decay
- P6.6.1Coin-flipping simulation
- P6.6.2Buffon's needle
- P6.6.3A simple model for chemotaxis
- P6.6.4Modeling meanders
- P6.7.1Apodization
- P6.7.2Fourier expansion of a square wave
- P6.7.3Fourier transform of a sound file
- P6.X.1The Gibbs phenomenon
- P6.X.2Measuring the Coefficient of Restitution
- P6.X.3Analysing Snakes and Ladders as a Markov Chain
- P6.X.4Structure factors for perfect crystals
- P6.X.5The temperature dependence of resistivity