• [^] # Re: Python

    Posté par . En réponse au journal Découvrir Docker, Python, LLVM et Emscripten. Évalué à 1.

    Ah, mais si tu veux de l'alambiqué, il y a toujours moyen de s'arranger:

    import numpy as N
    @N.vectorize 
    def starts_with(x, val): 
     return x[0] == val
    liste_a = list(N.array(some_list)[N.where(starts_with(some_list,"a"))])
    liste_b = list(N.array(some_list)[N.where(starts_with(some_list,"b"))])