EX.
NO : 1 Dataset Loading and Exploration using Python
Problem
A data analyst wants to understand the structure and characteristics of a dataset
before applying machine learning algorithms. The dataset contains information
such as student details, sales records, customer information, or other data
attributes. To prepare the data for analysis and model building, the analyst needs
to load the dataset into Python and perform exploratory operations such as
viewing records, identifying dimensions, checking data types, and obtaining
summary statistics.
Aim
To load a dataset into Python and explore its structure, dimensions, and
statistical properties.
Procedure
Step 1: Import the necessary libraries such as pandas and numpy.
Step 2: Load the dataset into Python using the read_csv() function.
Step 3: Display the first few rows of the dataset using head() to examine sample
records.
Step 4: Display the last few rows using tail() to inspect the ending records.
Step 5: Determine the dimensions of the dataset using shape.
Step 6: Display information about the dataset such as column names, data types,
and number of non-null values using info().
Step 7: Identify the list of columns present in the dataset.
Step 8: Check for missing values in the dataset.
Step 9: Generate summary statistics such as mean, standard deviation, minimum
value, and maximum value using describe().
Step 10: Interpret the dataset characteristics based on the output.
Python Coding
# Import necessary libraries
import pandas as pd
import numpy as np
# Load dataset
# Replace '[Link]' with your dataset name
data = pd.read_csv("[Link]")
# Display first five records
print("First Five Records:")
print([Link]())
# Display last five records
print("\nLast Five Records:")
print([Link]())
# Display shape of dataset
print("\nShape of Dataset:")
print([Link])
# Display information about dataset
print("\nDataset Information:")
print([Link]())
# Display column names
print("\nColumn Names:")
print([Link])
# Check missing values
print("\nMissing Values:")
print([Link]().sum())
# Generate summary statistics
print("\nSummary Statistics:")
print([Link]())
Result
Thus, the dataset was successfully loaded into Python and exploratory analysis
was performed to understand its structure and characteristics.