numpy numpy is the backbone of machine learning in python it is one of the most important libraries in python for numerical computations it adds support to core python for multi-dimensional arrays (and matricesand fast vectorized operations on these arrays the present day numpy library is successor of an early librarynumericwhich was created by jim hugunin and some other developers travis oliphantanaconda' president and co-foundertook the numeric library as base and added lot of modificationsto launch the present day numpy library in it is major open source project and is one of the most popular python libraries it' used in almost all machine learning and scientific computing libraries the extent of popularity of numpy is verified by the fact that major os distributionslike linux and macosbundle numpy as default package instead of considering it as an add-on package umpy ndarray all of the numeric functionality of numpy is orchestrated by two important constituents of the numpy packagendarray and ufuncs (universal functionnumpy ndarray is multi-dimensional array object which is the core data container for all of the numpy operations universal functions are the functions which operate on ndarrays in an element by element fashion these are the lesser known members of the numpy package and we will try to give brief introduction to them in the later stage of this section we will mostly be learning about ndarrays in subsequent sections (we will refer to them as arrays from now on for simplicity' sake arrays (or matricesare one of the fundamental representations of data mostly an array will be of single data type (homogeneousand possibly multi-dimensional sometimes the numpy ndarray is generalization of the same let' get started with the introduction by creating an array in [ ]import numpy as np arr np array([ , , , , ]arr out[ ]array([ ]in [ ]arr shape out[ ]( ,in [ ]arr dtype out[ ]dtype('int 'in the previous examplewe created one-dimensional array from normal list containing integers the shape attribute of the array object will tell us about the dimensions of the array the data type was picked up from the elements as they were all integers the data type is int one important thing to keep in mind is that all the elements in an array must have the same data type if you try to initialize an array in which the elements are mixedi you mix some strings with the numbers then all of the elements will get converted into string type and we won' be able to perform most of the numpy operations on that array so simple rule of thumb is dealing only with numeric data you are encouraged to type in the following code in an ipython shell to look at the error message that comes up in such scenarioin [ ]arr np array([ ,'st','er', ]arr dtype out[ ]dtype('< 'in [ ]np sum(arr