> > 
> > Domanda 2:
> > come faccio a sapere il numero di occorrenze  di X in un array?
> > (per
> > le
> > liste c'è count)
> > es.
> > a=np.array([1,2,3,4,3,2,1])
> > (tipo
> > a.count(2) -> 2
> > a.conut(4) ->1)
> 
> len(positions)

Questa però è meglio:

sum(a==X)

Gianfranco
_______________________________________________
Python mailing list
Python@lists.python.it
http://lists.python.it/mailman/listinfo/python

Rispondere a