Closed akselx closed 10 years ago
@akselx We noticed the same thing here. We temporarily solved the problem by adding a little "fillnas" model that we tacked on to the end of the models list. This code is ugly in many ways, but it does the trick in the short term. This should definitely be replaced with something more robust:
@sim.model("fillnas")
def fillnas():
for tblname in sim.list_tables():
print 'Filling NAs in {}'.format(tblname)
tbl = sim.get_table(tblname)._frame
tbl.replace([np.inf, -np.inf, np.nan], 0, True)
Aksel - this is fixed now - I just set the prices to zero and filter for residential buildings when getting the "average" price. There are probably other ways to fix it, but this seems fine. @jrayers with your model make sure to only take the average price of residential buildings as this will average in the zeros that used to be nans.
The run method fails when run a second time. First time it simulates ok, but subsequent times, it complains about NAs. This happens on Windows and Linux.