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: Programmazione sicura




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)

💬 Discussione della community e commenti

🌐 Entra nella chat principale

Avvia la discussione nel flusso broadcast della Social Chat oppure invia qui sopra un contributo esperto tramite il modulo di integrazione.

Briefing di sicurezza Gratuito · disdetta in 1 clic

Intelligence Digest — gratuito

Ogni giorno le notizie di sicurezza più importanti · annullabile in qualsiasi momento

Valutazione della community & prova sociale
⭐ Giudizio dei lettori
–
Ø / 5.0
Ancora nessuna valutazione dei lettori
Questo articolo ti è stato utile?
0
Lascia ora la tua valutazione
Valutazione dettagliata (facoltativa)
Contenuto & qualità
Fonte & credibilità
Attualità

Cluster di storie correlate & fonti (IA vettoriale)

6 Cluster
19 fonti
Walmart's Black Friday deals are live — shop our top picks now
Latest from TechRadar 40 min. fa
18 altre fonti
Latest from TechRadar39 min. faLive: Apple Black Friday deals — save on AirPods Pro 3, iPad 11-in, Apple Watch 12, AirTags & more WIRED44 min. faThe Best Early Black Friday MacBook Deals (2026) Latest from Windows Central44 min. faEssential Xbox Ally travel accessories drop their prices before Black Friday IT Security News41 min. faBeyond Black Friday: The Cyber Threats Retailers Need to Prepare for in 2026 Latest from TechRadar44 min. faBest Black Friday streaming deals from 99 cents: Apple TV, HBO Max, Paramount+, Peacock, and more CNET56 min. faThis Bissell Vacuum Tackles Tough Pet Hair and It’s Just $170 During the Black Friday Sales WIRED59 min. faGPS Dog Collar for Less: Our Top Tested Picks From Fi’s Black Friday Sale (2026) Latest from Windows Central59 min. faDell's excellent XPS laptops are up to 33% off in this early Black Friday sale WinFuture News1 h faBlack Friday bei VZMore: Bis 600 Euro Rabatt auf Power-Mini-PCs Latest from TechRadar1 h faThe best Black Friday turntable deals, as picked by an audio editor CNET12 giorni faUpgrade Your Home Security for Less. Score Up to 65% Off With These Black Friday Ring Deals Giga.de1 h faVor Black Friday zu viel bezahlt? Mit einem Trick könnt ihr doch noch sparen - Futurezone1 h faStreaming-Sticks zur Black Week: Mit diesen Deals sparst du bis zu 46 % t3n.de1 h faBlack Friday: Diese Samsung-Angebote bei Amazon und Media Markt lohnen sich netzwelt.de3 h faBlack-Friday-Kracher: Huawei-Smartwatch mit EKG für unter 150 Euro Golem.de1 h faAnzeige: Sony WH-1000XM6 Referenz-Kopfhörer am Black Friday zum Amazon-Bestpreis Macerkopf.de2 h faAmazon Black Friday: Apple Pencil, WISO Steuer 2027, Microsoft 365, iPhone 18 Cases und mehr Golem.de2 h faAnzeige: Fahrradcomputer von Garmin zum Black Friday reduziert bei Amazon
17 fonti
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 h fa
16 altre fonti
VulDB Updates2 h faCVE-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 h faCVE-2026-99715 | Linux Kernel up to 7.3.4/7.4-rc1 nvme-rdma nvme_rdma_queue_rq null pointer dereference VulDB Updates2 h faCVE-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 h faCVE-2026-99724 | Linux Kernel up to 7.3.4/7.4-rc1 NTFS ntfs_read_compressed_block out-of-bounds VulDB Updates2 h faCVE-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 h faCVE-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 h faCVE-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 h faCVE-2026-99746 | Linux Kernel up to 7.3.4/7.4-rc1 ASoC hda_sdw_bpt_close race condition VulDB Updates2 h faCVE-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 h faCVE-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 h faCVE-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 h faCVE-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 h faCVE-2026-99679 | Linux Kernel up to 7.3.4/7.4-rc1 xfs xfs_iomap_write_unwritten allocation of resources VulDB Updates2 h faCVE-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 h faCVE-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 h faCVE-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
Articoli simili
🔍 Verwandte News

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

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

Laden...

Caricamento dei video ...

Laden...

Caricamento degli articoli ...

Laden...

Caricamento dei video ...

Laden...

Caricamento degli articoli ...

Laden...

Caricamento dei video ...

Laden...

Caricamento degli articoli ...

Laden...

Caricamento dei video ...

Laden...

Caricamento degli articoli ...

Laden...

Caricamento dei video ...

💬 Caricamento dei commenti…
Trascina per aggiornare
Widgets & Topics
Loading widgets…
Nächster Beitrag