Pandas library is used to read CSV and EXCEL files data. Using pandas we can do data processing and data manipulation.
It is a very important library, before we apply any machine learning algorithm we need analysis of data. This library helps us to make analysis the data.
Import the Pandas library using the below command,
import pandas as pd
Read CSV file using read_csv(‘path to CSV file’) like below,
df = pd.read_csv('Salaries.csv');
To check the data directly execute the below command and you will see the below data,
df.head()
head() gives us the first 5 rows from the dataset. Below is the command and output,
head(n) gives us the first n rows from the dataset. Below are the command and output.
tail() gives the last 5 rows from the dataset like below,
tail(n) gives us the last n rows from the dataset like below,
Get total salary paid to all employee in 2011,
Get Maximum salary paid to the employee in every year,
Get the employee's name who is drawing the highest salary in each year,
Get the top 5 salaries with employee name in each year,
To get selected columns from the dataset use the below command,
Get Employee details who are getting Minimum Salary from each year,
Info() gives every column with the number of non-null values and Data type of each column,
describe() gives us a count of rows in each column, mean, median, 25%, 50%,75% of each column,
loc () to get specific rows from the dataset, pass index number to retrieve.
Thank you!!!