0Pricing
Data Science Academy · درس

عدّ القيم واكتشافها

تعرّف إلى value_counts وunique وعمليات الفحص السريع.

عدّ القيم واكتشافها درس مجاني في Data Science Academy على CoddyKit. هذا هو الدرس 4 من أصل 4. يمكنك قراءة الدرس كاملاً أدناه مجاناً — ثم تمرن عليه مباشرة في المتصفح باستخدام محرر أكواد مدمج ومدرس ذكاء اصطناعي متاح 24/7. هذا الدرس جزء من مسار التعلم في Data Science Academy، وتقدمك يتزامن عبر الويب وتطبيق CoddyKit. تتضمن دورة Data Science Academy 4 دروس في المجموع.

بعض أجزاء هذا الدرس لم تُترجم بعد وتظهر باللغة الإنجليزية.

Get to Know Your Column

Before any analysis, you want a feel for what is inside a Series. A few quick methods summarize the contents in seconds. 🔍

A Sample Series

Here is a Series of fruit names with some repeats. We will explore its contents with handy built-in methods.

import pandas as pd
s = pd.Series(['apple', 'pear', 'apple', 'fig', 'pear', 'apple'])

Count Each Value

The value_counts method tallies how often each value appears, sorted from most to least common. It is the fastest frequency check.

print(s.value_counts())

See the Distinct Set

Call unique to get every distinct value just once, in the order first seen. It answers what kinds of values you have.

print(s.unique())

How Many Distinct

The nunique method returns the count of distinct values as a single number. Here it tells you how many fruit kinds exist.

print(s.nunique())

Shares Instead of Counts

Add normalize=True to value_counts and you get proportions instead of raw counts. Now each fruit's share sums to one.

print(s.value_counts(normalize=True))

Spot Missing Values

The isna method flags each value that is missing as True. Summing those flags counts the gaps in your column at a glance.

nums = pd.Series([1.0, None, 3.0])
print(nums.isna().sum())

Check Membership

Use isin with a list to test which values belong to a chosen set. It returns a boolean mask you can filter with later.

print(s.isin(['apple', 'fig']))

Find the Extremes

For numbers, max and min surface the largest and smallest values instantly, without sorting the whole Series yourself.

print(nums.max(), nums.min())

One-Shot Overview

The describe method bundles count, unique, top, and frequency for text, giving a tidy snapshot in a single call. 📋

print(s.describe())

Your Inspection Toolkit

Together these methods are your first inspection pass on any column. A minute spent here saves hours of confused analysis later. 🧰

Quick Check

Pick the right tool for a frequency tally.

Recap

You can now profile a Series with value_counts, unique, nunique, isna, and isin. These quick checks reveal what your data holds. Well done! 🎉

الأسئلة الشائعة

هل درس «عدّ القيم واكتشافها» مجاني؟

نعم — نص درس «عدّ القيم واكتشافها» كامل متاح مجاناً هنا على الويب. لتمرينه بشكل تفاعلي (محرر أكواد مدمج ومدرس ذكاء اصطناعي متاح 24/7) وفتح باقي دورة Data Science Academy، انتقل إلى CoddyKit PRO. تتضمن دورة Data Science Academy 4 دروس في المجموع.

ماذا ستتعلم في «عدّ القيم واكتشافها»؟

تعرّف إلى value_counts وunique وعمليات الفحص السريع. تتمرن على Data Science Academy مع أكواد عملية تشغلها مباشرة في المتصفح، ومدرس ذكاء اصطناعي متاح 24/7 يجيب على أسئلتك أثناء عملك.

هل أحتاج إلى خبرة سابقة لأبدأ Data Science Academy؟

لا تُشترط خبرة سابقة. Data Science Academy على CoddyKit منظم للمبتدئين حتى المتقدمين، لذا يمكنك البدء من هنا أو من البداية والتقدم بسرعتك الخاصة. هذا هو الدرس 4 من أصل 4.

كم من الوقت يستغرق درس «عدّ القيم واكتشافها»؟

معظم دروس CoddyKit تستغرق حوالي 5–10 دقائق. كل منها موجز وتفاعلي، لذا تحرز تقدماً مستمراً وتستأنف من حيث توقفت عبر الويب والتطبيق.

هل يمكنني كتابة وتشغيل أكواد في درس Data Science Academy هذا؟

نعم. كل درس في Data Science Academy يتضمن محرر أكواد مدمج، لذا تكتب وتشغل أكواداً حقيقية مباشرة في متصفحك وتحصل على تعليقات فورية من الذكاء الاصطناعي — بدون إعداد محلي.

جميع الدروس في هذه الدورة

  1. عمود باسم وفهرس
  2. الوصول حسب التسميات مقابل الوصول حسب المواضع
  3. حسابات Series والمحاذاة
  4. عدّ القيم واكتشافها
← العودة إلى Data Science Academy