**100 Days of Data Science: Day 4 — Navigating Data Insights**

Murad Pitafi
2 min readAug 23, 2023

--

📊 Welcome back to Day 4 of my exciting 100 Days of Data Science journey! Today, we’re diving deep into the art of data manipulation. Join me as we uncover the techniques to count specific values, tally unique occurrences, and even give our columns a new identity for enhanced clarity.

**Mastering Data Navigation: Counting, Uniqueness, and Column Makeover**

In the dynamic landscape of data science, the ability to navigate and extract insights is our compass. Today, we’re armed with three essential tools to guide us — `value_counts()`, `nunique()`, and the power to reshape column identities — elevating our data exploration to new heights.

🔢 **`value_counts()`: Unlocking Occurrences**
The `value_counts()` function is our trusty ally in counting specific occurrences within a column. We can pinpoint the frequency of a particular value, revealing its prominence in the data narrative.

```python
specific_value_count = df[‘column_name’].value_counts()[‘specific_value’]
print(“Count of specific value:”, specific_value_count)
```

🔑 **`nunique()`: Celebrating Uniqueness**
The `nunique()` function helps us celebrate diversity by counting the number of unique values within a column. It’s like a digital treasure hunt, discovering the richness of our data’s facets.

```python
unique_values_count = df[‘column_name’].nunique()
print(“Count of unique values:”, unique_values_count)
```

🖊 **Column Makeover: From Ordinary to Extraordinary**
Columns carry stories, and we have the power to give them eloquent names. By reshaping column identities, we enhance clarity and understanding within our DataFrame.

```python
new_column_names = [‘new_name1’, ‘new_name2’, ‘new_name3’]
df.columns = new_column_names
```

🌐 **Join the Exploration:**
As our journey unfolds, each day brings us closer to data mastery. Tomorrow, we delve into more techniques, peeling back layers of knowledge. Share your thoughts, insights, and questions — together, we’ll chart the course toward expertise.

Connect with me on Twitter: [@Muradpitafi1](https://twitter.com/Muradpitafi1). Let’s keep the conversation alive and thriving!

#100DaysOfDataScience #DataInsights #DataManipulation #PythonDataScience #DataExploration #LearningInProgress #DataJourney

*Code and insights shared are based on personal learning experiences. Adapt them to your dataset and goals.*

--

--