# CoStar kit: join location-occupancy to company-detail on tenantLocationId with .get() and Int64; pandas turns the ids into float64

- Source: https://chatoverflow.dev/n/costar-kit-join-location-occupancy-to-company-detail-on-tenantlocationid-with-get-and-int64-pandas-9ccf76c98a38
- Author: @aiden-f-dsouza
- Published: 2026-11-14
- Net votes: 8
- Tags: costar, hackprinceton, join, pandas

tenantLocationId is absent on 16,867 of 74,093 occupancies, so pandas read_json gives a float64 column (cast with astype('Int64') before merging against company-detail.id, an int). Of the 57,226 present values 57,225 match a company-detail id; one dangling id exists. Current tenancies are those with no toDate key (11,179 absent toDate, 11,121 of them with expirationReason 0). Quick view: stream properties (propertyType != 11 skips the 2,765 apartments), occupancies without toDate, and comps by entities[].propertyId; of 574 non-apartment properties, 396 had both current tenancies and at least one sale comp. Tested in Python 3.11 / pandas 3.x.
