Zum Hauptinhalt springen
Echtzeit-Radar & Feeds
Alle RSS Feeds ➔
👥 Community & Social
Windows Tipps & SecurityGrafikkarte vor Überhitzung schützen: So geht’s(25.09.2026 um 08:00 Uhr)
••••••••••
Windows Tipps & SecurityGrafikkarte vor Überhitzung schützen: So geht’s(25.09.2026 um 08:00 Uhr)
••••••••••
Intelligence View
⚡ tsecurity.de Intelligence

How I check duplicate IDs and missing cells in CSV with Python

AI disclosure: This article was prepared with AI assistance and reviewed against the runnable sample and its reproducibility test. CSV quality problems often appear before a full validation framework is necessary. A quick first pass can…

0
↗ Quelle (dev.to)
Reagiere als Erste:r — dein Feedback zählt!

AI disclosure: This article was prepared with AI assistance and reviewed against the runnable sample and its reproducibility test.




CSV quality problems often appear before a full validation framework is necessary. A quick first pass can answer three useful questions:




  1. How many rows did we receive?

  2. Are IDs duplicated?

  3. Which columns contain blank cells?



The following example uses only Python's standard library and synthetic data.






Example CSV






id,amount,qty,category
A001,10.00,1,books
A002,5.50,2,toys
A003,,3,books
A001,10.00,1,books
A004,7.25,4,home
A005,abc,2,toys
A006,0,1,accessories






There are seven rows, one repeated ID, and one blank value in amount. Notice that abc is not blank—it is a separate numeric-validation problem. Keeping those concepts separate prevents a simple missing-value check from making claims it cannot support.






A limited quality check






import csv
from collections import Counter
from pathlib import Path


def profile_csv(path: Path, id_field: str = "id") -> dict:
with path.open("r", encoding="utf-8-sig", newline="") as handle:
reader = csv.DictReader(handle)
rows = [dict(row) for row in reader]
columns = list(reader.fieldnames or [])

id_counts = Counter(
row.get(id_field, "").strip()
for row in rows
if row.get(id_field, "").strip()
)
duplicate_id_count = sum(
count - 1 for count in id_counts.values() if count > 1
)
missing_cells = {
column: sum(1 for row in rows if not str(row.get(column, "")).strip())
for column in columns
}

return {
"row_count": len(rows),
"columns": columns,
"duplicate_id_count": duplicate_id_count,
"missing_cells": missing_cells,
}






For the sample above, the result is:




{
"row_count": 7,
"columns": ["id", "amount", "qty", "category"],
"duplicate_id_count": 1,
"missing_cells": {
"id": 0,
"amount": 1,
"qty": 0,
"category": 0
}
}









What this check does not do



A small script should state its limits clearly. This example does not:




  • convert numeric strings;

  • flag abc as an invalid number;

  • separate invalid rows;

  • expose an HTTP endpoint;

  • validate against an external schema;

  • make the data production-safe.



Those tasks require explicit rules and deeper tests. The useful design lesson is to return observable facts first, then add stricter behavior only when the data contract is known.






Reproducibility



The runnable preview repository contains the synthetic CSV, expected JSON response, and a no-dependency test: https://github.com/Kalamari0227/eidolon-csv-quality-preview



The expanded local HTTP API package, with numeric summaries and default/strict modes, is available here: https://ethanlee20.gumroad.com/l/dmuomd

1. Sofort-Triage & Abwehrmaßnahmen

SOC Incident Playbook: Vulnerability Remediation & Verification
Syntax validiert (0 Fehler)
title: Detect Exploitation - How I check duplicate IDs and missing cells in CSV with Python
id: 9fa55efd-d509-46e3-8ebd-a9c7084763aa
status: experimental
description: Automatisch generierte SIEM-Erkennungsregel basierend auf CTI Intelligence
references:
  - https://tsecurity.de/
author: iShareStuff CTI Automated Detection Engine
date: 2026-09-26
logsource:
  category: network_connection
  product: any
detection:
  selection:
      CommandLine|contains:
        - 'exploit'
  condition: selection
falsepositives:
  - Legitime administrative Zugriffe oder Penetrationstests
level: high
tags:
  - attack.initial_access
Syntax validiert (0 Fehler)
rule CTI_Threat_Indicator {
    meta:
        author = "iShareStuff CTI Automated Detection Engine"
        date = "2026-09-26"
        description = "YARA Signature for "
    strings:
        $str = "How I check duplicate IDs and " ascii wide
    condition:
        any of them
}
Syntax validiert (0 Fehler)
index=security sourcetype IN ("cisco:asa", "pan:traffic", "zeek_conn", "suricata", "WinEventLog:Security")
("How I check duplicate IDs and missing ce")
| stats count earliest(_time) as first_seen latest(_time) as last_seen by src_ip, dest_ip, dest_host, signature
| eval first_seen=strftime(first_seen, "%Y-%m-%d %H:%M:%S"), last_seen=strftime(last_seen, "%Y-%m-%d %H:%M:%S")
| sort - count
Syntax validiert (0 Fehler)
message: "*How I check duplicate IDs and missing ce*"
Syntax validiert (0 Fehler)
CommonSecurityLog
| where Message has "How I check duplicate IDs and missing ce"
| summarize EventCount = count(), FirstSeen = min(TimeGenerated), LastSeen = max(TimeGenerated) by SourceIP, DestinationIP, DestinationPort, Activity
| extend DetectionRule = "iShareStuff-CTI-Compiled"
| sort by EventCount desc

2. Cyber Threat Intelligence & Forensik

🎯
MITRE ATT&CK Matrix Navigator 14 Taktiken
Reconnaissance
-
Resource Development
-
Initial Access
Execution
Persistence
-
Privilege Escalation
Defense Evasion
Credential Access
-
Discovery
-
Lateral Movement
-
Collection
-
Command and Control
Exfiltration
-
Impact
tsecurity.de Cognitive Threat RAG
Fokus-Vektor:

Kognitive Analyse für identifizierte Bedrohung: Erhöhte Bedrohungslage im Bereich How I check duplicate IDs and missing ce.... Basierend auf 368k Vektor-Korrelationen werden sofortige Isolationsmaßnahmen für betroffene Endpunkte empfohlen.

🛡️ Angriffsfläche & Exposure

Netzwerk/Remote-Zugriff ohne Vorauthentifizierung möglich.

⚡ Empfohlene Sofortmaßnahmen
  • 1. Perimeter-Inspektion: Relevante Portfreigaben und exponierte Endpunkte unverzüglich scannen.
  • 2. Patch-Applikation: Hersteller-Hotfix einspielen oder betroffene Daemons in isolierte DMZ-Segmente überführen.
  • 3. Telemetrie & EDR-Alerts: Prozessaufrufe und Child-Processes auf anomale Shell-Spawns überwachen.
🔗 Semantisch verwandte Zero-Days MariaDB 11.7 VEC
Ähnliche Beiträge
🔍 Verwandte News

Auch interessante Nachrichten How I check duplicate IDs and missing cells in CSV with Python

Thematisch verwandte Begriffe: check, duplicate, missing, cells · 6 Treffer

Laden...

Videos werden geladen ...

Laden...

Beiträge werden geladen ...

Laden...

Videos werden geladen ...

Laden...

Beiträge werden geladen ...

Laden...

Videos werden geladen ...

Laden...

Beiträge werden geladen ...

Laden...

Videos werden geladen ...

Laden...

Beiträge werden geladen ...

Laden...

Videos werden geladen ...

Zum Aktualisieren ziehen
ZERO-DAY CVE-2026-100620 | Capgo CLI (npm package @capgo/cli) through 7.98.2 is affected by an ove…
Advisory →
tsecurity.de Icon
Offline-Lesen, Eilmeldungen & 0ms Ladezeit

Installiere tsecurity.de direkt auf deinen Home-Bildschirm für das ultimative Vollbild-Magazinerlebnis ohne Browser-Leisten.

Nächster Beitrag