index 1 is out of bounds for axis 0 with size 0
While doing the names of the columns part:
header_full = np.genfromtxt("loan-data.csv",
delimiter=';',
skip_footer= raw_data.shape[0],
autostrip= True,
dtype= str)
header_full
Generated the output
array([], dtype='<U1')
Rather than shown in the video
3 answers ( 0 marked as helpful)
hi ,
to get around this situation do the following
raw_data_np = np.genfromtxt("loan-data.csv", delimiter=';', encoding="cp1252",dtype=str)
header_full = raw_data_np[0,:]
raw_data_np = np.genfromtxt("loan-data.csv", delimiter=';', encoding="cp1252")
hi ,
to get around this situation do the following
raw_data_np = np.genfromtxt("loan-data.csv", delimiter=';', encoding="cp1252",dtype=str)
header_full = raw_data_np[0,:]
raw_data_np = np.genfromtxt("loan-data.csv", delimiter=';', encoding="cp1252")
I have the same issue, the only close solution I found was this:
header_full = np.genfromtxt("loan-data.csv",
names = True,
delimiter = ";",
autostrip = True,
encoding = "cp1252",
dtype = np.str_,
skip_footer = raw_data_np.shape[0]
)
header_full
Is adding **names = True **
Hope a soon answer for a better solution.