Python NumPy - Practice Exercises, Questions and Solutions Last Updated : 12 Sep, 2025 Comments Improve Suggest changes Like Article Like Report Example Questions on NumPy ArrayCreate an empty and full NumPy arrayCreate a Numpy array filled with all zerosCreate a Numpy array filled with all onesCheck whether a Numpy array contains a specified rowRemove rows in Numpy array that contains non-numeric valuesRemove single-dimensional entries from shape of an arrayFind number of occurrences of a sequenceFind most frequent valueCombining a one and a two-dimensionalBuild an array of all combinations of two NumPy arraysAdd a border around a NumPy arrayCompare two NumPy arraysCheck whether specified values are present in NumPy arrayGet 2D diagonals of a 3D arrayFlatten a MatrixFlatten a 2d array into 1d arrayMove axes of an array to new positionsInterchange two axes of an arrayFibonacci Series using Binet FormulaCounts number of non-zero valuesCount number of elements along a given axisTrim leading and/or trailing zeros from a 1-D arrayChange data type of given numpy arrayReverse a numpy arrayMake a NumPy array read-onlyCoding ProblemsSum of All Elements in a Numpy ArrayMaximum Element in a Numpy ArrayMean of a Numpy ArrayReshape a Numpy ArrayStandard DeviationElement-wise ExponentiationArray ConcatenationReverse Rows of a 2D ArrayDiagonal Elements in an Array3D Array from a List of ListsAccessing Element in a 3D ArrayMaximum Element along Each Axses in a 3D ArraySlice a 3D ArrayFlatten a 3D ArrayExample Questions on NumPy MatrixMaximum value from given matrixMinimum value from given matrixFind number of rows and columns of a given matrixSelect elements from a given matrixFind sum of values in a matrixCalculate sum of the diagonal elementsAdding and Subtracting Matrices Ways to add row/columnsMatrix MultiplicationGet eigen values of a matrixCalculate determinant of a matrix Inverse a matrix using NumPyCount frequency of unique valuesMultiply matrices of complex numbers Outer product of two given vectorsCalculate inner, outer and cross products of matrices and vectorsCompute covariance matrix of two given Convert covariance matrix to correlation matrix Compute Kronecker product of two mulitdimensionConvert matrix into a listCoding ProblemsMatrix MultiplicationTranspose of a MatrixExample Questions on NumPy IndexingReplace array elements that doesn’t satisfy given conditionReturn indices of elements where given condition is satisfiedReplace NaN values with average of columnsReplace negative value with zeroGet values of an NumPy array at certain index positionsFind indices of elements equal to zero Remove columns in array that contains non-numeric valuesAccess different rows of a multidimensional Get row numbers of array having element larger than XGet filled diagonals of arrayCheck elements present in an arrayCombined array index by indexExample Questions on NumPy Linear AlgebraFind a matrix or vector norm Calculate QR decomposition of a given matrix Compute condition number of a given matrix Compute eigenvalues and right eigenvectors of a given square array Calculate Euclidean distance Coding ProblemLinear AlgebraExample Questions on NumPy RandomCreate a Numpy array with random valuesChoose elements from the list with different probability Get weighted random choice Generate Random Numbers From Uniform Distribution Get Random Elements from geometric distributionGet Random elements from Laplace distributionReturn a Matrix of random values from a uniform distributionReturn a Matrix of random values from a Gaussian distributionQuestions on NumPy Sorting and SearchingGet indices of sorted array Finding k smallest values Get n-largest values of an array Sort values in a matrixFilter out integers from float numpy arrayFind indices into a sorted arrayCoding ProblemsSorting an ArraySearching in 2D ArraySorting Array by Each ColumnQuestions on NumPy MathematicsGet element-wise true division of an arrayCalculate element-wise absolute value of an arrayCompute negative of the NumPy arrayMultiply 2d numpy array corresponding to 1d arrayComputes inner product of two arraysCompute nth percentile of the NumPy arrayCalculate n-th order discrete difference along given axisCalculate sum of all columns in a 2D NumPy arrayCalculate average values of two given NumPy arraysCompute numerical negative value for all elements in an arrayGet floor, ceiling and truncated values of the elements of an arrayRound elements of NumPy array to nearest integerFind round off the values of given matrixDetermine positive square-root of an arrayEvaluate Einstein’s summation convention of two multidimensional NumPy arraysQuestions on NumPy StatisticsCompute median of the flattened NumPy arrayFind Mean of a List of Numpy ArrayCalculate mean of array ignoring NaN valueGet mean value from given matrixCompute variance of NumPy arrayCompute standard deviation of NumPy arrayCompute pearson product-moment correlation coefficients of two given arraysCalculate mean across dimension in a 2D NumPy arrayCalculate average, variance and standard deviation in Python Describe a NumPy Array Questions on PolynomialDefine a polynomial functionAdd one polynomial to another Subtract one polynomial to anotherMultiply a polynomial to another Divide a polynomial to another Find roots of the polynomials Evaluate a 2-D polynomial series on Cartesian productEvaluate a 3-D polynomial series on Cartesian productQuestions on NumPy StringsRepeat all elements of a NumPy array of stringsSplit element of a given NumPy array with spacesInsert a space between characters of all the elementsFind length of each string element in the Numpy arraySwap case of an array of stringChange case to uppercase of elements Change case to lowercase of elementsJoin String by a separatorCheck if two same shaped string arrayss one by oneCount number of substrings in an arrayFind lowest index of the substring in an arrayGet boolean array when values end with a particular characterMore Questions on NumPyDifferent ways to convert a dictionary to a NumPy arrayConvert a list and tuple into NumPy arraysWays to convert array of strings to array of floatsConvert a NumPy array into a csv fileConvert an image to NumPy array and save it to CSV file Save a NumPy array to a text fileLoad data from a text filePlot line graph from NumPy arrayCreate Histogram using NumPy Comment More infoAdvertise with us A abhishek1 Follow Improve Article Tags : Python Explore Python FundamentalsPython Introduction 3 min read Input and Output in Python 4 min read Python Variables 5 min read Python Operators 5 min read Python Keywords 2 min read Python Data Types 8 min read Conditional Statements in Python 3 min read Loops in Python - For, While and Nested Loops 7 min read Python Functions 5 min read Recursion in Python 6 min read Python Lambda Functions 5 min read Python Data StructuresPython String 5 min read Python Lists 5 min read Python Tuples 4 min read Dictionaries in Python 3 min read Python Sets 6 min read Python Arrays 7 min read List Comprehension in Python 4 min read Advanced PythonPython OOP Concepts 11 min read Python Exception Handling 6 min read File Handling in Python 4 min read Python Database Tutorial 4 min read Python MongoDB Tutorial 2 min read Python MySQL 9 min read Python Packages 12 min read Python Modules 7 min read Python DSA Libraries 15 min read List of Python GUI Library and Packages 3 min read Data Science with PythonNumPy Tutorial - Python Library 3 min read Pandas Tutorial 6 min read Matplotlib Tutorial 5 min read Python Seaborn Tutorial 15+ min read StatsModel Library- Tutorial 4 min read Learning Model Building in Scikit-learn 8 min read TensorFlow Tutorial 2 min read PyTorch Tutorial 7 min read Web Development with PythonFlask Tutorial 8 min read Django Tutorial | Learn Django Framework 7 min read Django ORM - Inserting, Updating & Deleting Data 4 min read Templating With Jinja2 in Flask 6 min read Django Templates 7 min read Python | Build a REST API using Flask 3 min read How to Create a basic API using Django Rest Framework ? 4 min read Python PracticePython Quiz 3 min read Python Coding Practice 1 min read Python Interview Questions and Answers 15+ min read Like