Python Forum
Do I have to pass 85 variables to function?
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Do I have to pass 85 variables to function?
#1
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.

#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+=1	  
race 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
Reply


Messages In This Thread
Do I have to pass 85 variables to function? - by Milfredo - Sep-25-2020, 05:06 AM

Possibly Related Threads…
Thread Author Replies Views Last Post
  How to pass encrypted pass to pyodbc script tester_V 0 858 Jul-27-2023, 12:40 AM
Last Post: tester_V
  How to print variables in function? samuelbachorik 3 913 Dec-31-2022, 11:12 PM
Last Post: stevendaprano
  User-defined function to reset variables? Mark17 3 1,652 May-25-2022, 07:22 PM
Last Post: Gribouillis
  How to pass variables from one class to another hobbyist 18 10,730 Oct-01-2021, 05:54 PM
Last Post: deanhystad
  Regex - Pass Flags as a function argument? muzikman 6 3,597 Sep-06-2021, 03:43 PM
Last Post: muzikman
  Possible to dynamically pass arguments to a function? grimm1111 2 2,187 Feb-21-2021, 05:57 AM
Last Post: deanhystad
  Pass by object reference when does it behave like pass by value or reference? mczarnek 2 2,559 Sep-07-2020, 08:02 AM
Last Post: perfringo
  print function help percentage and slash (multiple variables) leodavinci1990 3 2,490 Aug-10-2020, 02:51 AM
Last Post: bowlofred
  Pass integers to datetime.date function florian 3 2,728 Jul-18-2020, 04:43 AM
Last Post: scidam
  How to pass multiple arguments into function Mekala 4 2,455 Jul-11-2020, 07:03 AM
Last Post: Mekala

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020