The document provides an overview of NumPy and Pandas, two fundamental Python packages for numerical and data analysis. NumPy offers powerful N-dimensional arrays and various functions for mathematical operations, while Pandas focuses on manipulating tabular data through data structures like Series and DataFrames. It also lists common functions for both libraries, highlighting their utility in data science.
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF or read online on Scribd
0 ratings0% found this document useful (0 votes)
15 views7 pages
Corizo Class 2 - Numpy Pandas
The document provides an overview of NumPy and Pandas, two fundamental Python packages for numerical and data analysis. NumPy offers powerful N-dimensional arrays and various functions for mathematical operations, while Pandas focuses on manipulating tabular data through data structures like Series and DataFrames. It also lists common functions for both libraries, highlighting their utility in data science.
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF or read online on Scribd
You are on page 1/ 7
NumPy
+ Stands for Numerical Python
+ Itis one of the fundamental packages for mathematical, logical, and statistical operations with Python
+ Itcontains,
+ Powerful N-dimensional array object, called ndarray
+ Large set of functions for creating, manipulating, and transforming ndarrays
+ ndarrays can only contain data of a single datatype
+ Useful in linear algebra, vector calculus, random number capabilities, etePandas
+ Pandas is one of the fundamental packages for analysis and manipulation of tabular data
+ Offers two major data structures - series & dataframe
+ We can think of a pandas dataframe like an excel spreadsheet that's storing some data in rows and columns.
+ Apandas dataframe is made up of several pandas series
+ Each column of a dataframe is a series.
+ Pandas dataframes can contain data of multiple datatypes.Common NumPy Functions
rarer
np.array() To create an array
np.arange() Retum evenly spaced values within a given interval
nplinspace() | Return evenly spaced numbers over a specified interval
np .zeros() To create an array of zeros
np.ones() To create an array of ones
np.transpose() | Permute array dimensionsCommon NumPy Functions
rata Drea)
np.random.rand() To create an array of specified shape filled with random values
np.random.randint() | Return random integers from low (inclusive) to high (exclusive)
np.random.randn() | Return a sample (or samples) from the “standard normal” distribution.
np.concatenate() | Concatenate two arrays
np.save() Save an array to a binary file in .npy format.
np.savez() Save several arrays into a single file in uncompressed .npz format.Common Pandas Functions
Pree
pd.read_csv() | Read a comma-separated values (csv) file into DataFrame
dfloct] ‘Access a group of rows and columns by label(s)
dfiloc] Purely integer-location based indexing for selection by position
df.drop() Drop specified labels from rows or columns
pd.concat() To concatenate two pandas objects
pd.merge() To merge the pandas dataframes
df.groupby() | To spit, apply or combine the data structuresCommon Pandas Functions
tate) Dt
df.value_counts() _| To get count of some attributes
df.unique() To get unique values
di.dtype To get the data types
df.shape To get the shape (number or rows and columns)
df.head() To get the top rows
df-tail) To get the last rows
df.describe() To get the quick statistic summaryCommon Python Libraries for Data Science
NumPy
Scipy
Matpiotlib, Seaborn
Pandas
Scikit-learn
o
Handling multidimensional arrays
Scientific computation package
Data visualisation
Handling tabular data
Machine learning