Data Understanding and Initial Exploration
Before cleaning or modeling, you must get to know your data. This topic shows you how to take a first careful look at a new dataset and spot early problems, so you can plan the next steps with confidence.
Loading and Inspecting a Dataset
The first step is to load the data and look at it. In Pandas, head() shows the first few rows and tail() shows the last few. This gives you a quick feel for what the data looks like.
df = pd.read_csv("sales.csv")
print(df.head())
print(df.shape)The shape tells you the number of rows and columns. This helps you judge the size of the task. A small dataset may need different methods than a very large one.
Take your time with this step. Scroll through some rows and see if anything looks odd. Early curiosity often saves hours of trouble later in the project.
Understanding Columns and Data Types
Next, understand what each column means. Read any data dictionary that comes with the dataset. If there is none, ask the data owner or study the column names and sample values carefully.
Use df.info() to see the data type of each column and how many values are not missing. Check that numbers are stored as numbers, dates as dates, and text as text. Wrong types are a common problem.
Also identify the role of each column. Some are identifiers, some are features that may help predictions, and one may be the target you want to predict. Making a simple list of these helps you stay organized.
Summary Statistics
Summary statistics give a quick numeric picture of your data. The describe() method shows the count, mean, minimum, maximum, and quartiles for numeric columns.
print(df.describe())
print(df["category"].value_counts())For categorical columns, use value_counts() to see how often each value appears. This shows you the most common categories and any rare ones.
Look for strange results. A minimum age of negative 5 or a maximum price of 10 million may signal errors or special cases. Summary statistics are a fast way to catch these oddities.
Spotting Early Problems in Data
At this stage, you are looking for red flags. Common ones include missing values, duplicate rows, wrong data types, unusual values, and inconsistent spellings. Make a list of each issue you find.
print(df.isnull().sum())
print(df.duplicated().sum())Do not fix everything right away. First, understand how big each problem is and why it may have happened. Some missing values are normal, while others point to a real fault in collection.
Share your findings with the team. A short note describing the data quality and your concerns helps everyone set the right expectations. It also guides your cleaning plan in the next stage.
Data Science Lifecycle Tutorial
Wesline Rinisha








