remove a character from a data numpy array
remove a character from a data numpy array I am currently importing a .txt file to a numpy array. The .txt file is organized by three columns with hundreds of thousands of rows. Occasionally, for no apparent reason, the third column will have a attached to the number. This causes genfromtxt to import the number as nan . I have tried using a replace function for numpy , but I believe this function is looking for a string because I get an "EOL while scanning string literal" error code.enter image description here numpy genfromtxt nan numpy Any advice? import numpy as np import numpy.core.defchararray as np_f FLR = np.genfromtxt("C:UsersbrandDownloadsPythonMyFilesaupnipam_scan41_3DFLR.txt") FLR = np_f(FLR, '', '') x = FLR[:,][:,0] y = FLR[:,][:,1] z = FLR[:,][:,2] I've added a picture of what the raw data looks like to show what I mean by it having a "" in the data Following is the complete error code I get File "<ipython-...
