MLS2+Python+for+Data+Science+NumPy+and+Pandas-1
MLS2+Python+for+Data+Science+NumPy+and+Pandas-1
[email protected]
FK4AW1IM38
1. Pop Quiz
2. Common Python Libraries for Data Science
3. NumPy and Pandas
4. Common NumPy functions
5. Common Pandas functions
[email protected]
6. Merge vs Join
FK4AW1IM38 in Pandas
7. Example of Join
[email protected]
FK4AW1IM38
Library Use
● 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 is storing some data in rows and
columns.
● A pandas dataframe is made up of several pandas series
[email protected]
FK4AW1IM38○ Each column of a dataframe is a series.
● Pandas dataframes can contain data of multiple datatypes
Function Description
Function Description
np.random.randn() Return a sample (or samples) from the “standard normal” distribution.
[email protected]
np.concatenate()
FK4AW1IM38
Concatenate two arrays
np.savez() Save several arrays into a single file in uncompressed .npz format.
Function Description
Function Description
• Join: The join method works best when we are joining dataframes on their indexes (though you
can specify another column to join on for the left dataframe).
• Merge: The merge method is more versatile and allows us to specify columns besides the index
to join on for both dataframes.
[email protected]
FK4AW1IM38
[email protected]
FK4AW1IM38