• Как удалить строки в CSV?

    Carler
    @Carler Автор вопроса
    Ох уж эти таблицы
    with open('import.csv', newline='') as source:
        reader = csv.DictReader(source)
        with open('export.csv', mode='w', encoding='utf-8-sig', newline='') as destination:
    
            writer = csv.DictWriter(destination, dialect=csv.unix_dialect, fieldnames=reader.fieldnames)
            writer.writeheader()
            writer.writerows(
                filter(lambda x: x.get('date') not in weekend_days, reader)
            )
    Ответ написан