Sep-25-2020, 05:06 AM
Have a problem with a function. I am reading from a data frame and when the condition is met, I am putting data into a two dimensional array. There are about 85 data points. Question is, must I pass the data points to the function or is there an easier way to accomplish this.
Thanks
#LOAD HORSE DATA INTO 2 DIMENSION ARRAY FOR DATA PROCESSING def load_horse_data(): horse_array[horse_count][0] = race_number horse_array[horse_count][1] = todays_purse #READ FILE AND PULL OUT HORSES AND HORSE INFO FOR SELECTED RACE AND TRACK for i in range(0,len(xx)): if int(xx[hcount][1])== int(race_number): horses_name.insert(hcount, xx[hcount][18]) horse_saddle.insert(hcount, xx[hcount][97]) load_horse_data() horse_count +=1 hcount+=1race number I have as a global in bottom function just not showing it. So no problem in upper function Nputting race number in the array. But todays_purse throws an error as not defined. Bow I have 85 data points that will be put in array just as I am with the two I have listed so far. Do I have to pass all 85 to the function before I can put them in the array?
Thanks