0
0
Data Analysis Pythondata~5 mins

First data analysis walkthrough in Data Analysis Python

Choose your learning style9 modes available
Introduction

We do a first data analysis to understand what the data looks like and find useful information.

When you get a new dataset and want to know what it contains.
Before making decisions based on data, to check its quality and patterns.
To find simple summaries like averages or counts.
To spot missing or strange values in the data.
To prepare for more complex analysis or modeling.
Syntax
Data Analysis Python
import pandas as pd

# Load data
df = pd.read_csv('file.csv')

# See first rows
df.head()

# Get summary info
df.info()

df.describe()

pandas is a popular Python library for data analysis.

head() shows first rows, info() shows data types and missing values, describe() gives basic statistics.

Examples
Load data from a CSV file and show the first 5 rows.
Data Analysis Python
import pandas as pd

df = pd.read_csv('data.csv')
print(df.head())
Show information about columns, data types, and missing values.
Data Analysis Python
print(df.info())
Get basic statistics like mean, min, max for numeric columns.
Data Analysis Python
print(df.describe())
Sample Program

This code creates a small dataset, loads it into a table, and prints the first rows, info, and summary statistics.

Data Analysis Python
import pandas as pd

# Create a small example dataset
data = {
    'Name': ['Alice', 'Bob', 'Charlie', 'David', 'Eva'],
    'Age': [25, 30, 35, 40, 28],
    'Salary': [50000, 60000, 70000, 80000, 55000]
}

# Load data into DataFrame
df = pd.DataFrame(data)

# Show first rows
print('First rows:')
print(df.head())

# Show info
print('\nData info:')
df.info()

# Show summary statistics
print('\nSummary statistics:')
print(df.describe())
OutputSuccess
Important Notes

Always check the first few rows to understand the data structure.

Look for missing values or wrong data types with info().

Summary statistics help find outliers or unusual values.

Summary

First data analysis helps you understand your data quickly.

Use head(), info(), and describe() to explore data.

This step is important before any deeper analysis or modeling.