jeudi 23 novembre 2017

Conditional Statements and Subsetting - Python

Good Evening,

I have the following dataset as ndarray:

print(predict)
[[[  7.03453398e+00   1.00585070e+01   5.34464791e-03   4.08430994e-02
     1.73265897e-02   1.48283215e-02  -1.95482448e-02  -5.05701825e-02
     8.75583757e-03   6.01415014e+00   7.04624176e+00   8.97313499e+00
    -1.38850473e-02  -6.31546229e-02   4.99860048e+00   6.01915455e+00 ...

I would like to update this set, printing 0, if the value is < 0, and round each value.

How can I easily implement it in Python 3.?

Thanks, Alex

Aucun commentaire:

Enregistrer un commentaire