As I started work on this project, which was originally for a IBM Professional Data Science Certificate, I really wanted to produce some finding which would actually be useful in the real world. The course had examples of imagining that you were wanting to open a new coffee shop in a city you didn’t know – how could you decide where would be best. Sure, that might be helpful to anyone who’s thinking of opening a coffee shop in a city they don’t know – but really I thought that I could do better. What if I could augment the venue data with property prices for each area, what could that help me tell. My wife and I have been thinking to buy a place for a while now, and so could this help?.

Our personal preferences

When thinking about the places that we’d like to have near us, these were the things we felt would make the biggest difference on a daily/weekly basis. Feel free to skip ahead to get to the data part!

Nice Coffee

As a professional coffee addict trying to move from (a large) quantity of coffee, to perhaps even a single high quality cup of coffee a day, this is much easier with options where the coffee shop is roasting their own beans, or taking more care over the process.

Brunch Places

Early on in our relationship, we decided that satisfying my love of eggs benedict would be better served by finding nice brunch places ratyer than my darling wife spending any of her weekend slaving over a hot bain marie making hollendaise sauce.

Juice Bar

Eating healthily can be really hard, especially in these hectic and busy times. Much easier just to continue to eat your normal diet and then have a healthy smoothy to atone for all your sins and instantly become a healthy person!

Yoga Studios

My wife is a big fan of yoga, and has practiced it at home whereever we’ve lived, however having organised places around can make things a lot easier. Obviously the above is not a yoga studio but is the best we’ve found near where we live.

Looking through these proferences makes me feel like we’re exactly the same as all the other Guiris (foreign immigrants) here! But what do our preferences mean for property prices?

Where to get the data?

Barcelona is generally very good about access to data. The town council has been running an Open Data project, which currently has over 470 different datasets available. They have a few different data sets, however I chose to use a dataset provided by the property website Idealista (one of the best property websites I’ve ever used anywhere in the world). It gave the data down to a neighbourhood level and as a price per m2.

The course gave sample code which could get a sample of venues in a particular radius from Foursquare. (which interestingly has pivotted from focusing on “checkins” on their app, which seems kind of dated now, to being a leading data provider of this sort of information). I had to do quite a bit of work to extend this to allow me to overcome the new limits Foursquare place on the number of results available at a time, and also to allow me to precisely place each venue within it’s specific neighbourhood and sub-neighbourhood.

First I needed all of the venues in the whole of Barcelona (a process that took over a day to complete sucessfully and then I realised that I’d made a mistake with my coding, and had actually just repulled a single district 50 times rather than 50 different districts). Then I can summerize them by neighbourhood.

Nom_Barriprice_per_m2Tapas RestaurantSpanish RestaurantHotelMediterranean RestaurantRestaurantCaféBarBakeryGrocery StoreItalian RestaurantSupermarketPlazaPizza PlaceCoffee ShopJapanese RestaurantCocktail BarBurger JointParkBreakfast SpotHostelSandwich PlaceSeafood RestaurantWine BarChinese RestaurantAsian RestaurantMexican RestaurantIce Cream ShopGym / Fitness CenterGymBreweryDinerDeli / BodegaVegetarian / Vegan RestaurantDessert ShopBookstoreClothing StoreFalafel RestaurantSushi RestaurantTheaterGastropubBistroIndian RestaurantFood & Drink ShopPaella RestaurantArgentinian RestaurantBeer BarGardenArt GalleryNightclubHot Dog JointFast Food RestaurantSoccer FieldMarketBed & BreakfastFarmers MarketSporting Goods ShopWine ShopBeach BarScenic LookoutSnack PlaceFurniture / Home StoreMiddle Eastern RestaurantThai RestaurantGourmet ShopPeruvian RestaurantKorean RestaurantCupcake ShopBoutiqueElectronics StoreAthletics & SportsHotel BarBBQ JointTea RoomTrain StationMuseumDonut ShopCosmetics ShopPharmacyLatin American RestaurantYoga StudioLoungeBeachFrench RestaurantBeer GardenPubPedestrian PlazaMonument / LandmarkPoolSpaArts & Crafts StoreTram StationDance StudioSouth American RestaurantGift ShopPerforming Arts VenueToy / Game StoreRock ClubMultiplexHealth Food StoreJuice BarOptical ShopMusic VenueFried Chicken JointPlaygroundCafeteriaCultural CenterIndie Movie TheaterRecord ShopSports ClubSteakhouseDepartment StoreMetro StationSoccer StadiumArt MuseumHistoric SitePie ShopConcert HallPastry ShopTaco PlaceRamen RestaurantSalad PlaceKebab RestaurantEmpanada RestaurantCreperieMiscellaneous ShopSalon / BarbershopFlea MarketVietnamese RestaurantHobby ShopJazz ClubTurkish RestaurantTrailBig Box StoreRoof DeckLiquor StoreRoadChocolate ShopOrganic GroceryTennis CourtAccessories StoreBoarding HouseSkate ParkArcadeNoodle HouseScience MuseumPaper / Office Supplies StoreDog RunBrazilian RestaurantArepa RestaurantFish & Chips ShopFood CourtVideo Game StoreFoodFootball StadiumFood TruckHawaiian RestaurantMassage StudioBoard ShopBeer StoreCheese ShopConvenience StoreBasketball StadiumFruit & Vegetable StoreBuildingSports BarMoroccan RestaurantStadiumCollege GymMountainMovie TheaterTheme RestaurantShoe StoreHarbor / MarinaComfort Food RestaurantTrackSpeakeasyHookah BarPet StoreFountainDim Sum RestaurantFish MarketVenezuelan RestaurantWings JointBasketball CourtShopping MallGluten-free RestaurantFlower ShopAfrican RestaurantCaribbean RestaurantHistory MuseumBike Rental / Bike ShareMobile Phone ShopKids StoreKaraoke BarTech StartupHotel PoolAmerican RestaurantGay BarTheme Park Ride / AttractionBus StationAquariumSculpture GardenModern European RestaurantCoworking SpaceCastleCandy StorePortuguese RestaurantGym PoolLight Rail StationBaby StoreRental Car LocationIrish PubHardware StorePrint ShopWineryMotorcycle ShopVideo StoreGreek RestaurantClimbing GymMolecular Gastronomy RestaurantEvent SpaceWomen's StoreCamera StoreComic ShopPublic ArtGrilled Meat RestaurantSwiss RestaurantGerman RestaurantGarden CenterComedy ClubIndie TheaterFood StandRussian RestaurantGeneral TravelCollege CafeteriaGeneral EntertainmentBagel ShopSmoke ShopPlanetariumHockey ArenaCircusPalaceSurf SpotBowling AlleyEthiopian RestaurantBus StopOpera HouseNeighborhoodEastern European RestaurantUdon RestaurantHalal RestaurantPilates StudioTrack StadiumJewelry StoreButcherMusic StoreDoctor's OfficeZooBaseball StadiumHealth & Beauty ServiceOutdoors & RecreationFondue RestaurantCooking SchoolLaundromatSzechuan RestaurantBoat or FerryMedical CenterResidential Building (Apartment / Condo)TunnelGaming CafeLebanese RestaurantPersian RestaurantLighthouseCollege Residence HallFabric ShopCountry Dance ClubAuto GarageCambodian RestaurantTheme ParkHungarian RestaurantOfficeAnimal ShelterSouvenir ShopDive BarLibraryBuffetNail SalonExhibitPet CaféPhotography LabOther Great OutdoorsRomanian RestaurantAntique ShopGeneral College & UniversityPerfume ShopBridgeArts & EntertainmentKnitting StorePost OfficeFrozen Yogurt ShopCasinoMac & Cheese JointTennis StadiumScandinavian RestaurantDumpling RestaurantPolish RestaurantBathing AreaNudist BeachPakistani RestaurantMartial Arts DojoFilipino RestaurantAmphitheaterGymnastics GymSalsa ClubGas StationBurrito PlaceUniversityStreet ArtSkating RinkHome ServiceBotanical GardenIndonesian RestaurantSauna / Steam RoomHillVacation RentalTransportation ServiceGolf Course
Can Baró2598020000302101000000000001000000000100000000000000000000000000000000000000000000000000000000000000000000000000001000100000000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
Ciutat Meridiana1212000000001001000002000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
Diagonal Mar i el Front Marítim del Poblenou6506127776210400240231102000002000000004000010000000021000010800001000011310000110001202000000000000010200211000010000000000000000100000100000000101000000000000000010000010000010100000000010000000000000000000000000000000000001000000000000000000000101000100000000000000000000000000000000000100000000000001000000010000000000000000000
Horta2192751231130113210122223001001100011001000000100010010200000012000000000000001000010000210000000010000000000000100100000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000000000
Hostafrancs2742314342321011400030200011100000100010000010000000100010000000000010000110000000000000000000000000000000002010100000000000000000000010000000000000000000010000000000000000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
Navas2401200001215031001000101000100101000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000000
Pedralbes5436024313220111110012001000000300000000000101010040110000000000000000000101001000000000000000000000000000000000000010000000000000000001010000200000000000000000000000000000000000000000000000000000000010000000000000000100000000000000100000100000010000000000000000000000000000000000000000000000000000000000000000000000000000000000000
Porta2174231031113041201001001000100100110013100000100000000000000000010000010000000000000000000100000000000000000000001000000000000000000000100000000000000000002000000000000000000000100000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
Provençals del Poblenou3397041511010010101001000010200000001000100000001000010000000000000000000100000000000000000000000010000000000000110000000010011000000000001000100000000000000000000000000000000000000000000000000000001000000000000000000000000000000000100000000000000000000000000100000000000000000000000010000000000000000000000000000000000000000000000
Sant Andreu2391860636655285211112112100210013100000101000000201010100000001010100000001010000000000000001000010001000010100001000000000000000000000000001000000010000000000000000000000000000000200000010000000000000000001000100001000000000000000000000000001000000000000000000000000000000000000000000000000000000001000000000000000000000000000000
Sant Antoni3369718710111011441463420013034222101011122000111003300000010021001222200001001000100110000000000010100001000000010000000000010000000110000001100000000000001000000001000000000000000000000000000000000000001100000000000000000000000000000000010010000000000000000000000000000000000000000000000000000000000000000000100001010000000000000000
Sant Genís dels Agudells2140000001011010000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000
Sant Gervasi - Galvany4484412613810487824338323113121430311160202120120100012102010001001010100003000010000000020000100000001010100101000000000010000000001000000101000000000010001000000010000002000000000000000000000010000100020000120000000100000000000000010000000000000000000000001000000000000001000000000000000000000000000000000000000000000000000000100000
Sant Gervasi - la Bonanova4235262745772226223324200302000101000200000010100010210000101002000101000000020001000010001000100000000010000000100000000000000000000002000000000000100000000000000000000001000000000002000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000001000000000000000000000000000000000000000000000
Sant Martí de Provençals2273320202121030320101000001100110200000100000100000000200000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000100001000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
Sant Pere, Santa Caterina i la Ribera38271235233710400042521201270232001002111000200200012000021002000000000000000111010000021001010000000100010010100000001001000000020100000001000000001000010100000100000000001001100100010000000000010000000001000000000000100000010200000000000000000000000000000000001000100000000000000000000001001000000000000000000000000000000000000000
Sants281612668771263463335224130122012202010100100200100100101000101000020010000001100000000000210001000110010001000000000000021000000000011000000000000010000000010000000100000000000000000000000000000000000000000100000000000000000000000000000000000000000010000000001000000000000000000000000000000000000100000000000000000000000000000000000
Sants - Badal2607122122034040310000010000010111000000000000000000010000000000000000000000000001100000010010000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
Sarrià4704315545165222304143211011101110410200001000100000021110000010001000100000030001000011030000000010000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
Vallcarca i els Penitents2862212006114021000020210010000000000000000000000000001100000002100000000000000000000000000000000000000000000000000000000000000000000000000000100000000000000100000000001000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001000000000000
Verdun1710000011001000000001000000000000000000000000001000001000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
Vilapicina i la Torre Llobeta2193120022513122001110000100200000100111110000200000011000000000000000000000000000000000000001000000000000000000001000000000000000000000000000000000000000010000000001000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
el Baix Guinardó2841612011022111101002200101000010000000100000000000000001000010000000000000000000100001000000000000000000010000000000000000000001000100000000000000000010000000000000000001000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
el Barri Gòtic423613101153283010011144220011030026001012301200000011102010000010001100100000020200011011000010010000200100000000000000000100001000000001000000000001011000000000010000000001000000000010000000000000021000100001000020001000000010001000000000000000000100000010000000000000000000000000010000000000000000000110100000000000000000100000000000
el Besòs i el Maresme1951021130221010000000200000000110300000100000000000000000100000000000000010000000000000000000300000000002000000000100001000000000000000100000000100100000000000000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000000000000000000000000000000100000000000000000000
el Camp d'en Grassot i Gràcia Nova3219543407752021102110000001001020101010021010010010000111200000001010100000000001000000000000010000000000000000010010000000000000000000000001000000000000000000000000100000000000000000000100000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
el Camp de l'Arpa del Clot2619255245063331310032111012100000000100000000000000020000001001010000000001100000100001000000001000000000000000001000000100000100000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000
el Carmel1693220001102012030002100000100010000000000000000010001000100010000000000000000100000000000000000000000000000000000200000000000000000001000000000000000000100000000000000000100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
el Clot2505550122230121020212010001000110000200000000000000000100101000000001001000000000100000000000000000000000000000000000100100000000010000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000
el Coll2252001101010011000002000000000000000000000000000000000000000000000000000000000000000000000100000000000000100000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000010000000000000000000000000
el Congrés i els Indians2216510011021012011100001000000111100000010100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
el Fort Pienc3228555444125020121002120004311110020000103020101100002001110000000001000001012000110000000000000000001000000000000010001000000000101000000001000000010010000010000000000010000010000001000000000100000000000000000000000000000000000000000000000000000000000000000000000000100100000000000000000000000000000000000000000000000000000000000
el Guinardó2506511033211214210001200101010021010000000000001000000000100010000000000100000002000000100000000000000000010000000000100000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
el Parc i la Llacuna del Poblenou2956236442121041550020211001000210101001010010000001100000000000001000000000000100000001000000020000200122000000000002000000000000000000000000000000000000100000000010010000000000001000000000000000000000000000000000000000001000000000000000000100000000000000000000000000000000000000100000000000000000000000000000000000100000000010000
el Poble Sec28151596852411314810328051421110105110000005000011030310110000030000020000012001000011001002100000000100000000010000001101010001000000000010100000100000100000000000000000100100000000010000000001100010001000000100000000010000000000000000000000000010000000000100000000000010000001000000000000000000001000000000000000000000000000001000
el Poblenou360681041688472824622422311410223111112110210204123202010000100400000000200000100000000100000000000000101000001101010000000001022100000021000101000000000000000000001001100000000001001000000001000000001000000000000000000000010000001000000000001000001000000000000000000000000000100000000000000000000010000000000000000001000000000000000
el Putxet i el Farró3465112112095342410123210320000010110100000100200000000001000000003100101000210000000010000000000000010000000000000000000000000100000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000000000000000000000001000000000000010000000000
el Raval27751013119439501134321320124411132000013050005124000111011011000000000000000010100300001000202101020100000010000104000000010001001000100200010000000101000000000000000000000000011100000000000000010000000101000000001000000000000000000000011100001000000000100010000000000000000000000000000000000000000000000000000000000000000000000000000
el Turó de la Peira1887200002001010000001100000000000000100000000000000000100100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
l'Antiga Esquerra de l'Eixample399914161511121139182068121160443522142013143310143142003202001021010000201032100011000100101020000010000011112101000000000000020100100200001000100000010000000001000001011100000000001000010000111000000000000000000000000000000000100100000100000010000000000000000000000000000000000000010000000000000000100000000000000000000100000000000000000
la Barceloneta4043111041142930105212342100300002300110000020001291200200110001100000000010211000000101600000020001000000100000000010000000000000101000000000000000000000201001001020000000000010000000000000000000100000000000000000000000000000000000000000000000000101000000000000000000000000000000100000000000000000000000000000000000000000000000000000
la Bordeta2361200031001111210021000011000100000000101000100010000000000000000000000000000001000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000
la Dreta de l'Eixample4961121247191183819232666716132422304230013384302142003202000006030000402302172012101050022000002031002101000110100100000001000102100011001100020121022010110000010001100100000000010100000110000001000000110000000000000000010000000010010100000100000000000000000000010000000000000000000001000100000010000000000000000000000000000000100000000
la Font de la Guatlla2582102000021000001000010000000010000011010000000001010000000001000000000000000000000000000000000000000000000000000001000000000000000000000000000000001000000000000010000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
la Marina de Port2174030034212011000001000001100000000000000000000020000000110000100000000000000000000000000100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000011
la Maternitat i Sant Ramon3281245343411231431111020000000310213000010010100000201300010000000000000210001101000000000000400000000000000000100040000000000000000000000000001000100000000100000001100000000000000000000000000000000000000000000010000000000000000000010000100001000110000000000000000000000000000000000000000000000000000000000000000000000000000000000
la Nova Esquerra de l'Eixample3340521010810456240346231411011030145211000211103000010200001010020001033002000000010001001100100001000000000000100000000000000000000010100000100000000000000100010000000000100000000000000000001110001000100000000000000100000000000000000000000000000000000001000000000000001000000000000000000000000000000000000000000000000000000000000100
la Prosperitat1861350010211100020001100101000001000000010000000000000000000001000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
la Sagrada Família31575553105579644465140314132172123221010010100000100001011001000020121100010001000310000000000010102000000001010020000200110120000010010000020000000000010000000001000000000000001000000010000100000000000100000001000010001000000000000000001000000000000000000000000000000000000000000000000100000000000000000000000000000000001000000000
la Sagrera2498121020212023120021000200000010100000110000000000000000100001000000100000000001000000000001000010000000111000001000000000010000000000000000000000000000000010100000100000000000010000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
la Salut2825112110401120021002014000000000000110000000010000000010000030000000000000002000000001000100000100000000000000000001000000000000000000000000100000000000000000000000000000100000000000000000100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000001000000
la Teixonera1870120100111001000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
la Trinitat Vella1394110000000000000001000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000100000000000000000010000000
la Verneda i la Pau2023400002413121030010000001000000001000100000000000001110100000000000100100000001000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000001000000000000000000000000100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
la Vila Olímpica del Poblenou4728052225020201000012120201000101121000000001020000000000000100020000000000000010010100000100102000010000000000000000001000000000000000000000000010000100000000000000000100000010001000000000000000010000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
la Vila de Gràcia365513421413915827211544721142150234002113232333512001002100010113000120212310000200200021000001003010012110001000032000000000110100011000000000010000000000000000000000100000000000000000000010000000000100000000001000000000000100000010000000000000000000000000000000000000000000000000000000000000000000000000000000010000000010000000000000
les Corts382531597144387762279333213102301130112114030001120110102011032000201100011000000010000010110000000001001000100100001000010010001010000010001000010000000000000001100010010000000000000000000010001000001000000000000000000001000000000000000001000000000000000000000000010000000000000000001000010000010000000000000001000000000000000000000
les Roquetes1529000000001000000000000000000010100000100000000000000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000100101000000000000000000000000010000000000000000000000100000000000000000000000000000000000000000000000000000000000000000000
les Tres Torres5145033252141211102011001000110010000000010100000000000000000000000000000000010000000000000000000000010010000000100000000000200000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000000000000

Note, that the data in this table is interesting, it makes it simple to find the neighbourhood with the most parks, kebab shops, or whatever you might be curious to fine. Just click on the header of the column twice to get the largest values at the top.

Starting the Analysis

With this data we can use a statistical technique called Multiple Liniar regression. This process aims to uncover relationships between multiple numbers and a single dependent variable. In this case, we’re using the property price as our dependent variable and the numbers of each type of venue as the input. The process gives us a set of coefficients for each of our input columns.

Correlation does not mean causation

At this point I feel I need to repeat the most said saying in data science – that correlation doesn’t mean causation. That is that just becuase there’s a relationship between different statistics, doesn’t mean that one causes the other. There’s actually a fun site which contains a lot of pairs of statistics which appear to have some sort or relation, but common sense says can’t be any causual link. See below for an example, or check out this link to see more.

I think instinctively we understand that the average house prices are driven by more than just the venues nearby and that there are a lot of factors that apply.

The results

So what do our coefficents represent and how can we interpret them? Here are a couple of ways that we can understand them:

  • The higher the coefficient, the more often these venues appear in areas with higher property prices
  • If the property price was 100% caused by the venues in the same neighbourhood, then the coefficient would represent the incremental effect of each additional venue on the property price

While it’s nice to be super sciency and understand that this is clearly not giving the full picture, isn’t it fun just to imagine that the moment that the moment a new salad bar opens up, the properties in the area increase in value by €370 per m2 – that would mean the average property in the city that’s 78m2 would see an €28,860 increase! If you owned 35 proerties in the same area, and opened a salad bar, that would be a €1m windfall in additional investment value – truely salad days!

Venue typeCoefficientNumber of venues
Salad Place€3676
Multiplex€3198
Train Station€30011
Tennis Court€2935
Beach Bar€23714
Sports Club€2077
Gym / Fitness Center€20137
Historic Site€1717
Gym€16836
Paella Restaurant€16320
Athletics & Sports€15512
Optical Shop€1447
Theater€14126
Garden€13919
Yoga Studio€13211
Gastropub€13122
Donut Shop€13011
Trail€1205
Pedestrian Plaza€1209
Concert Hall€1126
Asian Restaurant€9840
Performing Arts Venue€908
Dessert Shop€8930
Bakery€88166
Beach€8710
Japanese Restaurant€8792
Flea Market€845
Hotel€81219
Fried Chicken Joint€817
Jazz Club€815
Taco Place€786
Italian Restaurant€77116
Indian Restaurant€7722
Indie Movie Theater€757
Café€71188
Salon / Barbershop€685
Seafood Restaurant€6846
Clothing Store€6727
Bar€66171
Liquor Store€635
Supermarket€53107
Breakfast Spot€5058
Thai Restaurant€4614
Roof Deck€465
Cosmetics Shop€4311
Wine Bar€4242
Playground€417
Latin American Restaurant€4011
Burger Joint€4081
Scenic Lookout€3914
Cafeteria€327
Vegetarian / Vegan Restaurant€3132
Museum€3011
Beer Garden€3010
Health Food Store€297
Empanada Restaurant€236
Snack Place€2214
Vietnamese Restaurant€185
Hot Dog Joint€1718
Middle Eastern Restaurant€1614
Art Museum€167
Market€1517
Korean Restaurant€1513
Pharmacy€1411
Pool€139
Falafel Restaurant€1227
Record Shop€127
Chinese Restaurant€1241
Deli / Bodega€1133
Soccer Stadium€77
Spanish Restaurant€7223
Department Store€67
Plaza€3106
Hostel€356
Miscellaneous Shop€25
Hotel Bar€212
French Restaurant€110
Cupcake Shop€013
Lounge-€110
Tram Station-€49
Big Box Store-€45
Rock Club-€68
Art Gallery-€1118
Hobby Shop-€125
Sushi Restaurant-€1227
Kebab Restaurant-€136
Pizza Place-€14103
Monument / Landmark-€169
Restaurant-€17199
Ice Cream Shop-€1938
Juice Bar-€197
Electronics Store-€2012
Spa-€239
Sandwich Place-€2348
Arts & Crafts Store-€299
Road-€325
Ramen Restaurant-€346
Steakhouse-€347
Gourmet Shop-€3814
Mexican Restaurant-€3839
Nightclub-€4118
Furniture / Home Store-€4314
Bed & Breakfast-€4316
Gift Shop-€458
Dance Studio-€468
Bistro-€4722
Turkish Restaurant-€515
Soccer Field-€5217
Organic Grocery-€525
Fast Food Restaurant-€5418
Coffee Shop-€56103
Tapas Restaurant-€59235
Cultural Center-€627
Park-€6674
Diner-€6933
Mediterranean Restaurant-€74211
Beer Bar-€7419
Music Venue-€777
Sporting Goods Shop-€7716
Toy / Game Store-€798
Cocktail Bar-€8885
Brewery-€9135
Pie Shop-€917
South American Restaurant-€948
Chocolate Shop-€945
BBQ Joint-€9712
Argentinian Restaurant-€10020
Peruvian Restaurant-€10014
Pastry Shop-€1016
Grocery Store-€102117
Wine Shop-€10215
Bookstore-€11129
Boutique-€12312
Tea Room-€13212
Food & Drink Shop-€13820
Creperie-€1616
Pub-€1659
Farmers Market-€18316
Metro Station-€3017

What does this mean for me?

Looking at the chart above, and being in our fun, but unscientific mindset where these relations are 100% causual, what does this mean for my wife and I’s preferences we talked about above? So if we were to take the average property size across the city is 78m2, this would mean that to live somewhere close to each of these venue types, would have the following affect on the price we’d need to pay for an apartment:

Venue typeCoefficient (effect)If applied to avg apartment
Coffee shop-€56-€4,368
Breakfast Spot – Brunch€50 €3,900
Juice Bar-€19-€1,482
Yoga Studio€132 €10,296
€8,346

Some Interesting Observations

There are a lot of things in this data which appears to make sense. Beach bars, gyms, tennis courts and historic sites are all things that you’d expect to be more related to areas with higher property prices. However, on the other side of the scale, as a Londoner, it’s surprising to see that according to this, a etro station is the worst thing you can have in your district. I’m going to ask my Catalan friends if they can cast some light on this. Similarly, a farmers market – surely one of the most desirable things possible to have in your locale in London, here probably correlates with more centralised urban areas, vs more modern spacious and expensive districts.

Final Thoughts

Where there things here you found suprising? I definelty would have thought that juice bars would have shown a more positive effect. Were there other things you would have liked to have seen? Leave a comment below and let’s see if we can find out.

This Post Has 2 Comments

  1. Leana Pooley

    This is all fascinating stuff – I’ve really enjoyed reading it. A lot of interesting, useful and also quirky research

  2. Tiago

    This makes want to return soooo bad! Even to an area without a bar. 🙂

Leave a Reply