def _lookup_parking_cfg(self, form, parking_config, df, only_built=True,
                            pass_through=None):

        dev_info = self.dev_d[(form, parking_config)]

        cost_sqft_col = np.reshape(dev_info.ave_cost_sqft.values, (-1, 1))
        cost_sqft_index_col = np.reshape(dev_info.index.values, (-1, 1))

        parking_sqft_ratio = np.reshape(dev_info.parking_sqft_ratio.values, (-1, 1))
        heights = np.reshape(dev_info.height.values, (-1, 1))

        # don't really mean to edit the df that's passed in
        df = df.copy()

        c = self.config

        # weighted rent for this form
        df['weighted_rent'] = np.dot(df[c.uses], c.forms[form])

        # min between max_fars and max_heights
        df['max_far_from_heights'] = df.max_height / c.height_per_story * \
            c.parcel_coverage

        # now also minimize with max_dua from zoning - since this pro forma is
        # really geared toward per sqft metrics, this is a bit tricky.  dua
        # is converted to floorspace and everything just works (floor space
        # will get covered back to units in developer.pick() but we need to
        # test the profitability of the floorspace allowed by max_dua here.
        if 'max_dua' in df.columns:
            # if max_dua is in the data frame, ave_unit_size must also be there
            assert df.columns in 'ave_unit_size'
            # so this is the max_dua times the parcel size in acres, which gives
            # the number of units that are allowable on the parcel, times
            # by the average unit size which gives the square footage of
            # those units, divided by the building efficiency which is a
            # factor that indicates that the actual units are not the whole
            # FAR of the building and then divided by the parcel size again
            # in order to get FAR - I recognize that parcel_size actually
            # cancels here as it should, but the calc was hard to get right
            # and it's just so much more transparent to have it in there twice
            df['max_far_from_dua'] = df.max_dua * \
                (df.parcel_size / 43560) * \
                df.ave_unit_size / self.config.building_efficiency / \
                df.parcel_size
            df['min_max_fars'] = df[['max_far_from_heights', 'max_far',
                                     'max_far_from_dua']].min(axis=1)
        else:
            df['min_max_fars'] = df[['max_far_from_heights', 'max_far']].min(axis=1)

        if only_built:
            df = df.query('min_max_fars > 0 and parcel_size > 0')

        fars = np.repeat(cost_sqft_index_col, len(df.index), axis=1)

        # turn fars into nans which are not allowed by zoning
        # (so we can fillna with one of the other zoning constraints)
        fars[fars > df.min_max_fars.values + .01] = np.nan

        # same thing for heights
        heights = np.repeat(heights, len(df.index), axis=1)

        # turn heights into nans which are not allowed by zoning
        # (so we can fillna with one of the other zoning constraints)
        fars[heights > df.max_height.values + .01] = np.nan

        # parcel sizes * possible fars
        building_bulks = fars * df.parcel_size.values

        # cost to build the new building
        building_costs = building_bulks * cost_sqft_col

        # add cost to buy the current building
        total_costs = building_costs + df.land_cost.values

        # rent to make for the new building
        building_revenue = building_bulks * (1-parking_sqft_ratio) * \
            c.building_efficiency * df.weighted_rent.values / c.cap_rate

        # profit for each form
        profit = building_revenue - total_costs

        profit = profit.astype('float')
        profit[np.isnan(profit)] = -np.inf
        maxprofitind = np.argmax(profit, axis=0)

        def twod_get(indexes, arr):
            return arr[indexes, np.arange(indexes.size)].astype('float')

        outdf = pd.DataFrame({
            'building_sqft': twod_get(maxprofitind, building_bulks),
            'building_cost': twod_get(maxprofitind, building_costs),
            'parking_ratio': parking_sqft_ratio[maxprofitind].flatten(),
            'stories': twod_get(maxprofitind, heights) / c.height_per_story,
            'total_cost': twod_get(maxprofitind, total_costs),
            'building_revenue': twod_get(maxprofitind, building_revenue),
            'max_profit_far': twod_get(maxprofitind, fars),
            'max_profit': twod_get(maxprofitind, profit),
            'parking_config': parking_config
        }, index=df.index)

        if pass_through:
            outdf[pass_through] = df[pass_through]

        resratio = c.res_ratios[form]
        nonresratio = 1.0 - resratio
        outdf["residential_sqft"] = outdf.building_sqft * c.building_efficiency * resratio
        outdf["non_residential_sqft"] = outdf.building_sqft * c.building_efficiency * nonresratio

        if only_built:
            outdf = outdf.query('max_profit > 0').copy()
        else:
            outdf = outdf.loc[outdf.max_profit != -np.inf].copy()

        return outdf
dataset/ETHPy150Open UDST/urbansim/urbansim/developer/sqftproforma.py/SqFtProForma._lookup_parking_cfg/swapped operands of `in`