Flatten a list

    0

    1

    Python public recipes

    Flatten a list using iteration_utilities

    Shortcut: list.deepflatten

    from iteration_utilities import deepflatten
    
    flatten_list = list(deepflatten(original_list, depth=2))
    
    Codiga Logo
    Codiga Hub
    • Rulesets
    • Playground
    • Snippets
    • Cookbooks
    soc-2 icon

    We are SOC-2 Compliance Certified

    G2 high performer medal

    Codiga – All rights reserved 2022.