I am relatively new to Python and I'm trying to call a class on an object but getting an error. I have a geodataframe (demand) that is the centroid of block groups, and a point file that is one store location. I've created a service area around the store locations, and pulled all block group centroids falling within the service area as demand points. I'm trying to use the aceso.GravityModel to calculate gravity based measurements of spatial accessibility to the store from the block group centroids.
aceso.GravityModel(demand['servicearea'], 'gaussian_decay', demand['Per_Capita'], False)
Aside from the official documentation for the class here, I was unable to find anyone who had used the class.
I'm using the above code to call the GravityModel call but I get the error - "Name: servicearea, dtype: object is not a callable object". I've provided explanations of the arguments below:
demand['servicearea'] - The service area that each block group centroid falls in (i.e. 5 minute drive time, 10 minute drive time, 15 minute drive time - actual values are 5, 10, 15 respectively)
'gaussian_decay': decay_function
demand['Per_Capita'] : decay_params (not sure if this is the right column to use but I took this to mean that the decay function will be applied on this column)
False: for huff_normalization argument
I apologize if the q is very convoluted and not explained well. Many thanks in advance for any advice/insight. Also, as a side note, any advice of how I can create a weighted demand catchment area would be much appreciated - thank you thank you!