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: Programmation sécurisée




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)

💬 Discussion communautaire et commentaires

🌐 Rejoindre le chat principal

Lancez la discussion dans le flux diffusé du Social Chat ou proposez ci-dessus une contribution experte via le formulaire de complément.

Briefing sécurité Gratuit · désabonnement en 1 clic

Intelligence Digest — gratuit

Chaque jour, les principales actualités sécurité · résiliable à tout moment

Évaluation communautaire & preuve sociale
⭐ Avis des lecteurs
–
Ø / 5.0
Pas encore d'évaluation des lecteurs
Cet article vous a-t-il été utile ?
0
Donner votre évaluation
Évaluation détaillée (facultatif)
Contenu & qualité
Source & fiabilité
Actualité

Groupes d’histoires apparentées & sources (IA vectorielle)

6 Cluster
22 sources
Walmart's Black Friday deals are live — shop our top picks now
Latest from TechRadar il y a 31 min.
21 autres sources
Latest from TechRadaril y a 31 min.Live: Apple Black Friday deals — save on AirPods Pro 3, iPad 11-in, Apple Watch 12, AirTags & more WIREDil y a 36 min.The Best Early Black Friday MacBook Deals (2026) Latest from Windows Centralil y a 36 min.Essential Xbox Ally travel accessories drop their prices before Black Friday IT Security Newsil y a 33 min.Beyond Black Friday: The Cyber Threats Retailers Need to Prepare for in 2026 Latest from TechRadaril y a 35 min.Best Black Friday streaming deals from 99 cents: Apple TV, HBO Max, Paramount+, Peacock, and more CNETil y a 47 min.This Bissell Vacuum Tackles Tough Pet Hair and It’s Just $170 During the Black Friday Sales WIREDil y a 51 min.GPS Dog Collar for Less: Our Top Tested Picks From Fi’s Black Friday Sale (2026) Latest from Windows Centralil y a 51 min.Dell's excellent XPS laptops are up to 33% off in this early Black Friday sale WinFuture Newsil y a 1 hBlack Friday bei VZMore: Bis 600 Euro Rabatt auf Power-Mini-PCs Latest from TechRadaril y a 1 hThe best Black Friday turntable deals, as picked by an audio editor Latest from TechRadaril y a 52 min.40+ best Black Friday deals in the UK — Switch 2, Shark vacuums, iPhone 18, Lego, PS5 bundles, Samsung, LG OLED TVs, and more CNETil y a 12 joursUpgrade Your Home Security for Less. Score Up to 65% Off With These Black Friday Ring Deals Giga.deil y a 1 hVor Black Friday zu viel bezahlt? Mit einem Trick könnt ihr doch noch sparen - Futurezoneil y a 55 min.Streaming-Sticks zur Black Week: Mit diesen Deals sparst du bis zu 46 % t3n.deil y a 1 hBlack Friday: Diese Samsung-Angebote bei Amazon und Media Markt lohnen sich netzwelt.deil y a 3 hBlack-Friday-Kracher: Huawei-Smartwatch mit EKG für unter 150 Euro Golem.deil y a 1 hAnzeige: Sony WH-1000XM6 Referenz-Kopfhörer am Black Friday zum Amazon-Bestpreis Macerkopf.deil y a 2 hAmazon Black Friday: Apple Pencil, WISO Steuer 2027, Microsoft 365, iPhone 18 Cases und mehr Golem.deil y a 2 hAnzeige: Fahrradcomputer von Garmin zum Black Friday reduziert bei Amazon CNETil y a 13 joursGet up to 50% off Select Alexa Devices With Amazon’s Black Friday Upgrade Deal CNETil y a 5 joursBlack Friday Is Knocking Hundreds Off Apple’s iPads, and There’s Plenty to Choose From
17 sources
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 il y a 1 h
16 autres sources
VulDB Updatesil y a 1 hCVE-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 Updatesil y a 1 hCVE-2026-99715 | Linux Kernel up to 7.3.4/7.4-rc1 nvme-rdma nvme_rdma_queue_rq null pointer dereference VulDB Updatesil y a 1 hCVE-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 Updatesil y a 1 hCVE-2026-99724 | Linux Kernel up to 7.3.4/7.4-rc1 NTFS ntfs_read_compressed_block out-of-bounds VulDB Updatesil y a 1 hCVE-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 Updatesil y a 1 hCVE-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 Updatesil y a 1 hCVE-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 Updatesil y a 1 hCVE-2026-99746 | Linux Kernel up to 7.3.4/7.4-rc1 ASoC hda_sdw_bpt_close race condition VulDB Updatesil y a 2 hCVE-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 Updatesil y a 2 hCVE-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 Updatesil y a 2 hCVE-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 Updatesil y a 2 hCVE-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 Updatesil y a 2 hCVE-2026-99679 | Linux Kernel up to 7.3.4/7.4-rc1 xfs xfs_iomap_write_unwritten allocation of resources VulDB Updatesil y a 2 hCVE-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 Updatesil y a 2 hCVE-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 Updatesil y a 2 hCVE-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
Articles similaires
🔍 Verwandte News

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

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

Laden...

Chargement des vidéos ...

Laden...

Chargement des articles ...

Laden...

Chargement des vidéos ...

Laden...

Chargement des articles ...

Laden...

Chargement des vidéos ...

Laden...

Chargement des articles ...

Laden...

Chargement des vidéos ...

Laden...

Chargement des articles ...

Laden...

Chargement des vidéos ...

💬 Chargement des commentaires…
Sentinel CTI: ONLINE
Tirer pour actualiser
Widgets & Topics
Loading widgets…
Nächster Beitrag