Zum Hauptinhalt springen
Intelligence View
⚡ tsecurity.de Intelligence

Gelişmiş Veri İşleme (Python)

Gelişmiş Veri İşleme (Python) Sıralama, Filtreleme ve Arama – Profesyonel Veri Manipülasyonu Rehberi Python’da veri işleme, sadece döngülerden ibaret değildir. …

Beitrag
0
Seite
0
↗ Quelle (dev.to)
Quelle & Fakten · 6 Min. Lesezeit
Quelle: dev.to
Rubrik: Sichere Programmierung




Gelişmiş Veri İşleme (Python)






Sıralama, Filtreleme ve Arama – Profesyonel Veri Manipülasyonu Rehberi



Python’da veri işleme, sadece döngülerden ibaret değildir. Modern Python yaklaşımı; fonksiyonel programlama araçları, yüksek seviyeli built-in fonksiyonlar ve lambda ifadeleri ile daha kısa, daha okunabilir ve daha performanslı çözümler üretmeyi hedefler.



Bu bölümde dört kritik alanı derinlemesine inceleyeceğiz:




  • sorted() ile gelişmiş sıralama

  • lambda ile karmaşık veri yapıları üzerinde sıralama

  • filter() ve map() ile fonksiyonel veri dönüşümü

  • any() ve all() ile toplu doğrulama (validation)



Her bölümde gerçek dünya senaryoları ve hands-on örnekler olacak.









1. sorted() Fonksiyonu — Gelişmiş Sıralama Motoru






1.1 Temel Yapı






sorted(iterable, key=None, reverse=False)






Parametreler:





  • iterable: Liste, tuple, set vb.


  • key: Sıralama kriteri (fonksiyon)


  • reverse: True → büyükten küçüğe









1.2 Basit Sıralama





```python id="s1"

sayilar = [5, 1, 9, 3, 7]



sonuc = sorted(sayilar)



print(sonuc)







---

## 1.3 Ters Sıralama



```python id="s2"
sayilar = [5, 1, 9, 3, 7]

print(sorted(sayilar, reverse=True))












1.4 Tuple Sıralama





```python id="s3"

veri = (10, 5, 20, 15)



print(sorted(veri))







---

## 1.5 String Sıralama (ASCII mantığı)



```python id="s4"
kelimeler = ["python", "ai", "data", "backend"]

print(sorted(kelimeler))












2. key Parametresi — Sıralamanın Beyni



sorted() fonksiyonunun gerçek gücü burada başlar.









2.1 String Uzunluğuna Göre Sıralama





```python id="k1"

kelimeler = ["python", "ai", "veri", "makineöğrenmesi"]



sonuc = sorted(kelimeler, key=len)



print(sonuc)







---

## 2.2 Sayıların Moduna Göre Sıralama



```python id="k2"
sayilar = [10, 3, 7, 21, 14, 9]

sonuc = sorted(sayilar, key=lambda x: x % 5)

print(sonuc)












2.3 Tuple Sıralama (Gerçek Dünya)





```python id="k3"

urunler = [

("Laptop", 45000),

("Mouse", 500),

("Monitör", 12000)

]



sonuc = sorted(urunler, key=lambda x: x[1])



print(sonuc)







---

## 2.4 Çok Katmanlı Sıralama

Fiyat → sonra isim



```python id="k4"
urunler = [
("Laptop", 45000),
("Mouse", 500),
("Monitör", 12000),
("Laptop Pro", 45000)
]

sonuc = sorted(
urunler,
key=lambda x: (x[1], x[0])
)

print(sonuc)












2.5 Dictionary Sıralama





```python id="k5"

urunler = {

"Laptop": 45000,

"Mouse": 500,

"Monitör": 12000

}



sonuc = sorted(

urunler.items(),

key=lambda x: x[1]

)



print(sonuc)







---

# 3. Lambda ile Karmaşık Sıralama

Lambda = isimsiz fonksiyon

---

## 3.1 Temel Lambda



```python id="l1"
f = lambda x: x * 2

print(f(5))












3.2 Sıralamada Lambda Kullanımı





```python id="l2"

ogrenciler = [

{"ad": "Ali", "not": 80},

{"ad": "Ayşe", "not": 95},

{"ad": "Mehmet", "not": 70}

]



print(sorted(ogrenciler, key=lambda x: x["not"]))







---

## 3.3 En Yüksek Not



```python id="l3"
print(sorted(ogrenciler, key=lambda x: x["not"], reverse=True))












3.4 Çok Alanlı Sıralama





```python id="l4"

data = [

{"ad": "Ali", "not": 80, "yas": 22},

{"ad": "Ayşe", "not": 80, "yas": 20},

{"ad": "Mehmet", "not": 70, "yas": 25}

]



sonuc = sorted(

data,

key=lambda x: (-x["not"], x["yas"])

)



print(sonuc)







---

# 4. filter() — Veri Filtreleme Motoru

## 4.1 Temel Yapı



```python
filter(function, iterable)












4.2 Çift Sayıları Filtreleme





```python id="f1"

sayilar = [1, 2, 3, 4, 5, 6]



ciftler = list(filter(lambda x: x % 2 == 0, sayilar))



print(ciftler)







---

## 4.3 Boş Değer Temizleme



```python id="f2"
veri = ["Ali", "", "Ayşe", None, "Mehmet"]

temiz = list(filter(None, veri))

print(temiz)












4.4 10’dan Büyük Sayılar





```python id="f3"

sayilar = [5, 10, 15, 3, 20]



sonuc = list(filter(lambda x: x > 10, sayilar))



print(sonuc)







---

## 4.5 Dictionary Filter



```python id="f4"
urunler = [
{"ad": "Laptop", "stok": 10},
{"ad": "Mouse", "stok": 0},
{"ad": "Monitör", "stok": 5}
]

sonuc = list(
filter(lambda x: x["stok"] > 0, urunler)
)

print(sonuc)












5. map() — Veri Dönüştürme Motoru






5.1 Temel Yapı






map(function, iterable)












5.2 Sayıları 2 ile Çarpma





```python id="m1"

sayilar = [1, 2, 3, 4]



sonuc = list(map(lambda x: x * 2, sayilar))



print(sonuc)







---

## 5.3 String Uppercase



```python id="m2"
isimler = ["ali", "ayşe", "mehmet"]

sonuc = list(map(str.upper, isimler))

print(sonuc)












5.4 Float → Int Dönüşüm





```python id="m3"

sayilar = [1.2, 3.7, 5.9]



sonuc = list(map(int, sayilar))



print(sonuc)







---

## 5.5 Dictionary Transform



```python id="m4"
urunler = [
{"ad": "Laptop", "fiyat": 1000},
{"ad": "Mouse", "fiyat": 50}
]

sonuc = list(
map(lambda x: x["fiyat"] * 1.2, urunler)
)

print(sonuc)












5.6 map + lambda vs comprehension





```python id="m5"






map



list(map(lambda x: x * 2, range(5)))






comprehension (tercih edilir)



[x * 2 for x in range(5)]







---

# 6. any() — En Az Bir True Var mı?

## 6.1 Temel Kullanım



```python id="a1"
sayilar = [0, 0, 1, 0]

print(any(sayilar))












6.2 Şart Kontrolü





```python id="a2"

sayilar = [2, 4, 6, 7]



print(any(x % 2 == 1 for x in sayilar))







---

## 6.3 Kullanıcı Kontrolü



```python id="a3"
kullanicilar = [
{"aktif": False},
{"aktif": False},
{"aktif": True}
]

print(any(u["aktif"] for u in kullanicilar))












7. all() — Hepsi True mu?






7.1 Temel Kullanım





```python id="al1"

sayilar = [1, 2, 3, 4]



print(all(sayilar))







---

## 7.2 Tüm Sayılar Pozitif mi?



```python id="al2"
sayilar = [1, 2, 3, -1]

print(all(x > 0 for x in sayilar))












7.3 Validation Sistemi





```python id="al3"

form = {

"email": "[email protected]",

"password": "12345",

"username": "admin"

}



print(all(form.values()))







---

# 8. any() vs all() Karşılaştırma

| Fonksiyon | Anlam |
| --------- | ------------ |
| any() | en az 1 True |
| all() | hepsi True |

---

# 9. Gerçek Hayat Hands-On Projeler

---

## 9.1 Log Analizi Sistemi



```python id="r1"
loglar = [
{"level": "INFO"},
{"level": "ERROR"},
{"level": "INFO"}
]

errors = list(
filter(lambda x: x["level"] == "ERROR", loglar)
)

print(errors)












9.2 En Pahalı Ürün





```python id="r2"

urunler = [

("A", 100),

("B", 500),

("C", 300)

]



en_pahali = max(urunler, key=lambda x: x[1])



print(en_pahali)







---

## 9.3 Geçerli Kullanıcı Kontrolü



```python id="r3"
kullanicilar = [
{"ad": "Ali", "aktif": True},
{"ad": "Ayşe", "aktif": False}
]

print(any(u["aktif"] for u in kullanicilar))
print(all(u["aktif"] for u in kullanicilar))












9.4 Veri Pipeline





```python id="r4"

data = [10, 15, 20, 25, 30]



sonuc = list(

map(

lambda x: x * 2,

filter(lambda x: x > 15, data)

)

)



print(sonuc)







---

# 10. Performans Perspektifi

* comprehension > map/filter (çoğu durumda)
* sorted() C implementasyonu ile çok hızlıdır
* any/all short-circuit çalışır (erken durur)

---

# 11. Python ve C# Karşılaştırma

## sorted()



```python
sorted(data, key=lambda x: x["not"])









data.OrderBy(x => x.Not);












filter()






list(filter(lambda x: x > 10, data))









data.Where(x => x > 10);












map()






list(map(lambda x: x * 2, data))









data.Select(x => x * 2);












12. Özet



Bu makalede öğrendiklerin:






sorted()




  • Gelişmiş sıralama

  • key parametresi

  • lambda ile multi-sort






filter()




  • veri eleme

  • koşullu filtreleme






map()




  • veri dönüşümü






any / all




  • toplu doğrulama









Sonuç



Bu fonksiyonlar Python’un fonksiyonel programlama çekirdeğini oluşturur.



Modern backend, AI pipeline, data engineering sistemlerinde:




  • sorted → ranking

  • filter → cleaning

  • map → transformation

  • any/all → validation



olarak kritik rol oynar.

Social ReaktionenReagiere als Erste:r — dein Feedback zählt!
Informations-Bewertung:
✏️ Information ergänzen
🛡️ Versioniert via CMS-Revisions-Engine (Freigabe-Queue für Gäste)

💬 Dyskusja społeczności i komentarze

🌐 Dołącz do głównego czatu

Rozpocznij dyskusję w strumieniu transmisji Social Chat lub prześlij wyżej wkład ekspercki przez formularz uzupełnień.

Security Briefing Bezpłatnie · Wypisanie 1 kliknięciem

Intelligence Digest - bezpłatnie

Codziennie najważniejsze wiadomości bezpieczeństwa · można pobrać w każdej chwili

Community Rating & Social Proof
⭐ Ocena czytelników
–
Ø / 5.0
Brak recenzji czytelników
Czy ten artykuł był pomocny?
0
Dodaj swoją ocenę
Ocena szczegółowa (opcjonalnie)
Treść i jakość
Źródło i wiarygodność
Aktualność

Powiązany klaster opowieści i źródła (wektor AI)

6 Cluster
19 źródeł
Walmart's Black Friday deals are live — shop our top picks now
Latest from TechRadar 40 minut temu
18 kolejnych źródeł
Latest from TechRadar39 minut temuLive: Apple Black Friday deals — save on AirPods Pro 3, iPad 11-in, Apple Watch 12, AirTags & more WIRED44 minuty temuThe Best Early Black Friday MacBook Deals (2026) Latest from Windows Central44 minuty temuEssential Xbox Ally travel accessories drop their prices before Black Friday IT Security News41 minut temuBeyond Black Friday: The Cyber Threats Retailers Need to Prepare for in 2026 Latest from TechRadar44 minuty temuBest Black Friday streaming deals from 99 cents: Apple TV, HBO Max, Paramount+, Peacock, and more CNET56 minut temuThis Bissell Vacuum Tackles Tough Pet Hair and It’s Just $170 During the Black Friday Sales WIRED59 minut temuGPS Dog Collar for Less: Our Top Tested Picks From Fi’s Black Friday Sale (2026) Latest from Windows Central59 minut temuDell's excellent XPS laptops are up to 33% off in this early Black Friday sale WinFuture News1 godzinę temuBlack Friday bei VZMore: Bis 600 Euro Rabatt auf Power-Mini-PCs Latest from TechRadar1 godzinę temuThe best Black Friday turntable deals, as picked by an audio editor CNET12 dni temuUpgrade Your Home Security for Less. Score Up to 65% Off With These Black Friday Ring Deals Giga.de1 godzinę temuVor Black Friday zu viel bezahlt? Mit einem Trick könnt ihr doch noch sparen - Futurezone1 godzinę temuStreaming-Sticks zur Black Week: Mit diesen Deals sparst du bis zu 46 % t3n.de1 godzinę temuBlack Friday: Diese Samsung-Angebote bei Amazon und Media Markt lohnen sich netzwelt.de3 godziny temuBlack-Friday-Kracher: Huawei-Smartwatch mit EKG für unter 150 Euro Golem.de1 godzinę temuAnzeige: Sony WH-1000XM6 Referenz-Kopfhörer am Black Friday zum Amazon-Bestpreis Macerkopf.de2 godziny temuAmazon Black Friday: Apple Pencil, WISO Steuer 2027, Microsoft 365, iPhone 18 Cases und mehr Golem.de2 godziny temuAnzeige: Fahrradcomputer von Garmin zum Black Friday reduziert bei Amazon
17 źródeł
CVE-2026-99707 | Linux Kernel up to 6.12.117/6.18.63/7.3.4/7.4-rc1 khugepaged collapse_file use after free
VulDB Updates 2 godziny temu
16 kolejnych źródeł
VulDB Updates2 godziny temuCVE-2026-99728 | Linux Kernel up to 7.3.4/7.4-rc1 Deferred Split Scan mm/huge_memory deferred_split_scan/deferred_split_folio race condition VulDB Updates2 godziny temuCVE-2026-99715 | Linux Kernel up to 7.3.4/7.4-rc1 nvme-rdma nvme_rdma_queue_rq null pointer dereference VulDB Updates2 godziny temuCVE-2026-99730 | Linux Kernel up to 6.12.117/6.18.63/7.3.4/7.4-rc1 Filemap mm/filemap.c filemap_fault race condition VulDB Updates2 godziny temuCVE-2026-99724 | Linux Kernel up to 7.3.4/7.4-rc1 NTFS ntfs_read_compressed_block out-of-bounds VulDB Updates2 godziny temuCVE-2026-99725 | Linux Kernel up to 6.12.117/6.18.63/7.3.4/7.4-rc1 CIPSO cipso_v4_delopt buffer overflow VulDB Updates2 godziny temuCVE-2026-99735 | Linux Kernel up to 6.12.117/6.18.63/7.3.4/7.4-rc1 MGLRU mm/mglru.c walk_pud_range/walk_pmd_range race condition VulDB Updates2 godziny temuCVE-2026-99744 | Linux Kernel up to 6.12.117/6.18.63/7.3.4/7.4-rc1 atl1c atl1c_clean_rfd length buffer overflow VulDB Updates2 godziny temuCVE-2026-99746 | Linux Kernel up to 7.3.4/7.4-rc1 ASoC hda_sdw_bpt_close race condition VulDB Updates2 godziny temuCVE-2026-99690 | Linux Kernel up to 6.12.117/6.18.63/7.3.4/7.4-rc1 ocfs2 ocfs2_get_dentry_osb use after free VulDB Updates2 godziny temuCVE-2026-99678 | Linux Kernel up to 6.12.117/6.18.63/7.3.4/7.4-rc1 XFS xfs_iomap_write_direct integer overflow VulDB Updates2 godziny temuCVE-2026-99680 | Linux Kernel up to 6.12.117/6.18.63/7.3.4/7.4-rc1 XFS xfs_fs_map_blocks allocation of resources VulDB Updates2 godziny temuCVE-2026-99688 | Linux Kernel up to 6.12.117/6.18.63/7.3.4/7.4-rc1 sch_qfq net/sched/sch_qfq.c qfq_change_class use after free VulDB Updates2 godziny temuCVE-2026-99679 | Linux Kernel up to 7.3.4/7.4-rc1 xfs xfs_iomap_write_unwritten allocation of resources VulDB Updates2 godziny temuCVE-2026-99686 | Linux Kernel up to 6.18.63/7.3.4/7.4-rc1 vhost vhost_add_used_n_in_order integer overflow VulDB Updates2 godziny temuCVE-2026-99697 | Linux Kernel up to 6.12.117/6.18.63/7.3.4/7.4-rc1 memcontrol high_work_func use after free VulDB Updates2 godziny temuCVE-2026-99685 | Linux Kernel up to 6.12.117/6.18.63/7.3.4/7.4-rc1 iommu/virtio viommu_probe use after free
Podobne wkłady
🔍 Verwandte News

Auch interessante Nachrichten Gelişmiş Veri İşleme (Python)

Thematisch verwandte Begriffe: Gelişmiş, Veri, İşleme, Python · 6 Treffer

Laden...

Filmy są załadowane...

Laden...

Składki są załadowane...

Laden...

Filmy są załadowane...

Laden...

Składki są załadowane...

Laden...

Filmy są załadowane...

Laden...

Składki są załadowane...

Laden...

Filmy są załadowane...

Laden...

Składki są załadowane...

Laden...

Filmy są załadowane...

Uwagi Komentarze są ładowane..
Rysunek do aktualizacji
Widgets & Topics
Loading widgets…
Nächster Beitrag