I have integer numbers in a text file to be assigned to an array C[5][100]. My data is in this format:
17 40 35 24 50 15 31 38 48 18 16 44
41 10 26 50 48 20 24 12 48 24 34 39
...............
I am trying the code below but the error I get is this:
ValueError: cannot copy sequence with size 1005 to array axis with dimension 100
text_file = open("c051001.txt", "r")
C=np.zeros((5,100))
for i in range(agent):
C[i,]=map(int, (value for value in text_file.read().split()))
Number of integers in the file is more than 500 but I want to assign the remainder of numbers to another array.