0Pricing
Data Science Academy · Ders

Filtreleri AND ve OR ile Birleştirme

Birden çok koşulu güvenli biçimde zincirleme

Filtreleri AND ve OR ile Birleştirme, CoddyKit'te ücretsiz bir Data Science Academy dersidir. Bu, 4 dersinin 3. dersidir. Aşağıdan dersin tamamını ücretsiz okuyabilir, sonra tarayıcıda yerleşik kod editörü ve 7/24 yapay zeka koçu ile uygulamalı olarak pratik yapabilirsin. Bu, Data Science Academy öğrenme yolunun bir parçasıdır ve ilerlemeniz web ve CoddyKit uygulaması arasında senkronize olur. Data Science Academy kursu toplamda 4 dersten oluşur.

Bu dersin bazı bölümleri henüz çevrilmemiş olup İngilizce olarak gösterilmektedir.

One Condition Is Rarely Enough

Real questions stack conditions: adults in Paris, or orders that are late and large. You need to combine filters cleanly. 🧩

Use the Ampersand for AND

To require both conditions, join the two masks with the ampersand. It works element by element across the rows.

df[(df["age"] > 30) & (df["city"] == "Paris")]

Use the Pipe for OR

To accept either condition, join the masks with the pipe. A row passes if at least one side is True.

df[(df["city"] == "Paris") | (df["city"] == "Lyon")]

Wrap Each Condition in Parentheses

Always put parentheses around each condition. Without them, Python evaluates the operators in the wrong order and raises an error.

df[df["age"] > 30 & df["score"] > 80]   # breaks

Why Not and or or?

The plain words and and or work on single True/False values, not on whole Series. For row masks you must use the symbols.

# wrong: df[(df["age"] > 30) and (...)]
# right: use & instead

Invert With the Tilde

The tilde flips a mask, turning True into False. It is the clean way to say not this condition.

df[~(df["city"] == "Paris")]   # everyone not in Paris

Mix AND and OR Carefully

You can blend operators, but parentheses decide the grouping. Make your intent explicit so the logic reads the way you mean it.

df[(df["age"] > 30) & ((c == "Paris") | (c == "Lyon"))]

Three or More Conditions

Stacking more masks works the same way. For readability, build them on separate lines, then combine the named masks.

old = df["age"] > 30
top = df["score"] > 80
df[old & top]

AND Narrows, OR Widens

Keep the mental model simple: AND shrinks the result toward fewer rows, while OR grows it toward more rows.

Combine Across Columns

Your conditions can touch different columns at once, letting you express rich questions in a single expression.

df[(df["age"] > 30) & (df["active"] == True)]

Save Complex Masks

When logic gets dense, give the combined mask a clear name. Future you will thank you for the readable variable.

vip = (df["age"] > 30) & (df["score"] > 80)
df[vip]

Quick Check

Pick the expression that filters correctly.

Recap: Combining Filters

Use the ampersand for AND, the pipe for OR, the tilde to invert, and always wrap each condition in parentheses. Complex questions, one clean line. ✅

Sıkça Sorulan Sorular

“Filtreleri AND ve OR ile Birleştirme” dersi ücretsiz mi?

Evet — “Filtreleri AND ve OR ile Birleştirme” dersin tüm metni burada web'de ücretsiz olarak okunabilir. Etkileşimli olarak pratik yapmak (yerleşik kod editörü ve 7/24 yapay zeka koçu) ve Data Science Academy kursunun geri kalanını açmak için CoddyKit PRO'ya yükselt. Data Science Academy kursu toplamda 4 dersten oluşur.

“Filtreleri AND ve OR ile Birleştirme” dersinde ne öğreneceğim?

Birden çok koşulu güvenli biçimde zincirleme Data Science Academy ile uygulamalı kodu tarayıcıda doğrudan çalıştırarak pratik yaparsın ve 7/24 yapay zeka koçu dersi çalışırken sorularını yanıtlar.

Data Science Academy öğrenmeye başlamak için deneyim gerekli mi?

Önceden deneyim gerekmez. CoddyKit'te Data Science Academy, başlangıçtan ileri seviyeye kadar yapılandırıldığı için buradan başlayabilir veya başından başlayıp kendi hızında ilerleme yapabilirsin. Bu, 4 dersinin 3. dersidir.

“Filtreleri AND ve OR ile Birleştirme” dersi ne kadar sürer?

Çoğu CoddyKit dersi yaklaşık 5–10 dakika sürer. Her biri kısa ve etkileşimli olduğu için sabit ilerleme yaparsın ve web ile uygulama arasında tam olarak bıraktığın yerden devam edebilirsin.

Bu Data Science Academy dersinde kod yazıp çalıştırabilir miyim?

Evet. Her Data Science Academy dersi yerleşik bir kod editörü içerir, bu sayede tarayıcıda gerçek kod yazıp çalıştırabilir ve anlık yapay zeka geri bildirimi alırsın — yerel kurulum gerekli değildir.

Bu kursun tüm dersleri

  1. Sütunları Ada Göre Seçme
  2. Koşullarla Satırları Filtreleme
  3. Filtreleri AND ve OR ile Birleştirme
  4. Temiz Filtreler için query ve isin
← Data Science Academy Sayfasına Dön