الصفوف والأعمدة والفهرس
كوّن النموذج الذهني لـ DataFrame.
الصفوف والأعمدة والفهرس درس مجاني في Data Science Academy على CoddyKit. هذا هو الدرس 1 من أصل 4. يمكنك قراءة الدرس كاملاً أدناه مجاناً — ثم تمرن عليه مباشرة في المتصفح باستخدام محرر أكواد مدمج ومدرس ذكاء اصطناعي متاح 24/7. هذا الدرس جزء من مسار التعلم في Data Science Academy، وتقدمك يتزامن عبر الويب وتطبيق CoddyKit. تتضمن دورة Data Science Academy 4 دروس في المجموع.
بعض أجزاء هذا الدرس لم تُترجم بعد وتظهر باللغة الإنجليزية.
A Table You Can Code
A DataFrame is pandas' spreadsheet in code: rows and columns of data you can slice, sort, and compute on instantly. 📊
Two Axes, One Grid
Every DataFrame has two axes: rows run top to bottom, columns run left to right. Together they form one tidy grid of values.
Columns Are the Variables
Each column holds one variable, like price or city, and shares a single data type. Think of a column as one measured thing.
Rows Are the Records
Each row is one record: a customer, a day, a sale. Read a row across and you get the full story of one observation.
Meet the Index
The index is the label down the left side that names every row. By default it counts 0, 1, 2, but it can be anything unique.
df.indexColumns Have Labels Too
The column headers form their own label set, the columns attribute. You select data by these names instead of guessing positions.
df.columnsShape Tells the Size
The shape attribute returns rows and columns as a pair. shape[0] is your row count, shape[1] is your column count.
df.shape # (rows, cols)One Column Is a Series
Pull a single column and pandas hands you a Series: a one-dimensional labeled array. A DataFrame is really a stack of Series.
df["price"]Set a Meaningful Index
You can promote a column to be the index when it identifies rows, like an order id. It makes lookups clearer and faster.
df.set_index("order_id")Labels Drive Everything
Pandas aligns and joins data by labels, not row order. That is why a thoughtful index quietly powers most of your analysis.
Reset When You Need To
Need a plain counting index back? reset_index moves the current index into a column and gives you fresh 0-based labels.
df.reset_index()Quick Check
Time to test the mental model of a DataFrame.
Recap: The DataFrame Map
Rows are records, columns are variables, and the index labels every row. Know this map and the rest of pandas clicks. 🗺️
الأسئلة الشائعة
هل درس «الصفوف والأعمدة والفهرس» مجاني؟
نعم — نص درس «الصفوف والأعمدة والفهرس» كامل متاح مجاناً هنا على الويب. لتمرينه بشكل تفاعلي (محرر أكواد مدمج ومدرس ذكاء اصطناعي متاح 24/7) وفتح باقي دورة Data Science Academy، انتقل إلى CoddyKit PRO. تتضمن دورة Data Science Academy 4 دروس في المجموع.
ماذا ستتعلم في «الصفوف والأعمدة والفهرس»؟
كوّن النموذج الذهني لـ DataFrame. تتمرن على Data Science Academy مع أكواد عملية تشغلها مباشرة في المتصفح، ومدرس ذكاء اصطناعي متاح 24/7 يجيب على أسئلتك أثناء عملك.
هل أحتاج إلى خبرة سابقة لأبدأ Data Science Academy؟
لا تُشترط خبرة سابقة. Data Science Academy على CoddyKit منظم للمبتدئين حتى المتقدمين، لذا يمكنك البدء من هنا أو من البداية والتقدم بسرعتك الخاصة. هذا هو الدرس 1 من أصل 4.
كم من الوقت يستغرق درس «الصفوف والأعمدة والفهرس»؟
معظم دروس CoddyKit تستغرق حوالي 5–10 دقائق. كل منها موجز وتفاعلي، لذا تحرز تقدماً مستمراً وتستأنف من حيث توقفت عبر الويب والتطبيق.
هل يمكنني كتابة وتشغيل أكواد في درس Data Science Academy هذا؟
نعم. كل درس في Data Science Academy يتضمن محرر أكواد مدمج، لذا تكتب وتشغل أكواداً حقيقية مباشرة في متصفحك وتحصل على تعليقات فورية من الذكاء الاصطناعي — بدون إعداد محلي.
جميع الدروس في هذه الدورة
- الصفوف والأعمدة والفهرس
- بناء DataFrame من الصفر
- head وinfo وdescribe
- إضافة الأعمدة وإعادة تسميتها وحذفها