python Genfromtxt how convert negative integer in to 0 -


img = np.genfromtxt (path+file,dtype=int,                 invalid_raise=false,                 missing_values= (all negatives), <<<---------------                 usemask=false,                 filling_values=0) 

i need catch negative integers , replace them 0. maybe can write code?

you can using .clip() follows:

img = img.clip(0) 

Popular posts from this blog

c# - ODP.NET Oracle.ManagedDataAccess causes ORA-12537 network session end of file -

matlab - Compression and Decompression of ECG Signal using HUFFMAN ALGORITHM -

utf 8 - split utf-8 string into bytes in python -