Professional Documents
Culture Documents
These are certain steps involved in data analysis. Let’s take a look at how data analysis
works in anaconda and various libraries that we can use.
Collecting Data
The collection of data is as simple as loading a CSV file in the program. Then we can
make use of the relevant data to analyze particular instances or entries in the data.
Following is the code to load the CSV data in the program.
1 import pandas as pd
2 import numpy as np
3 import matplotlib.pyplot as plt
4 import seaborn as sns
5
df = pd.read_csv('filename.csv')
6 print(df.head(5))
7
Slicing And Dicing
After we load the data set in the program, we must filter the data with a few changes like
eliminating the null values and unnecessary fields that may cause ambiguity in the
analysis.
Following is an example of how we can filter the data according to the requirements.
1 print(df.isnull().sum())
2 #this will give the sum of all the null values in the dataset.
3 df1 = df.dropna(axis=0 , how= 'any')
#this will drop rows with null values.
4