I'm not sure if my post question makes lots of sense; however, I'm building an input array for a class/function that takes in a lot of user inputed data and outputs a numpy array.
# I'm trying to build an input array that should include following information:
'''
* zone_id - id from db - int
* model size - int
* type of analysis - one of the following:
* type 1 - int or string
* type 2 - int or string
* type 3 - int or string
* model purposes:
* default: ONE, TWO, THREE #this is just a title of the purpose
* Custom: default + others (anywhere from 0 to 15 purposes)
* Modeling step 1: some socio economic factors #produces results 1
* Modeling step 2:
* Default: equation coefficients for retail/non retail
* Custom: equation coefficients for each extra activities as defined by
the user
* produces results 2
Example array:
def_array = (zone_id, model_size, analysis_type,
model_purpose[],
socio_economics[],
socio_coefficients[] )
'''
# Numerical example:
my_arr = [np.array([ 10001, 1, 2,
[ 'ONE', 'TWO', 'THREE', 'FOUR', 'FIVE' ],
[ {'retail':500, 'non_retail':300, 'school':300', 'other':900} ],
[ {'retail':500, 'non_retail':300, 'school':300', 'other':900} ],
[ {'ONE':{'retail':.5, 'non_retail':1.7, 'school':.4', 'other':4.7},
{'TWO':{'retail':.2, 'non_retail':2.5, 'school':.5', 'other':4.3},
{'THREE':{'retail':.3, 'non_retail':2.3, 'school':.6', 'other':2.2},
{'FOUR':{'retail':.4, 'non_retail':1.1, 'school':.7', 'other':1.0},
{'FIVE':{'retail':7, 'non_retail':2, 'school':3', 'other':1} ] ])
# this array will be inserted into 3 functions and together should return the following array:
arr_results = [np.array([ 10001, one_1, TWO_1, THREE_1, FOUR_1, FIVE_1, ONE_2, TWO_2, THREE_2, FOUR_2, FIVE_2],
[10002, .... ,] ])
- What are/is my best option(s) in defining the input array(s)?