Skip to content

Maxwel-2/social_segregation_France

Repository files navigation

social_segregation_France

Lil' Python program I've coded during a R&D internship used to analyse social segregation at multiple scales on a geodataframe. It agregate two populations distincly, here social housing and total housing, and we're looking at the social housing rate for every starting point and every agregation level.

All data come from the 2013 national Census leaded by the INSEE. Avaible here.

Based on a method developped by Julien RANDON-FURLING and Madalina OLTEANU and Antoine LUCQUIAUD in "From urban segregation to spatial structure detection" published in Environment and Planning B: Urban Analytics and City Science in 2017. This model was generalized since, more details in "Segregation through the multiscalar lens" published in PNAS by Madalina OLTEANU, Julien RANDON-FURLING and William A. V. CLARK in 2019.

!!!! NEED OPTIMIZATION AND ADAPTIBILITY !!!!

Required packages

  • Numpy
  • Pandas
  • Matplotlib
  • Geopandas
  • Scikit Learn

How to use ?

  1. If you want to run Paris example you must download the shapefile here and put it into social_segregation_France file.

  2. Open Segregation_analysis.py

  3. Put your geodataframe in df.

  4. Choose two variables you want to consider in the dedicated statement. Take care : calculation will be logs/logt.

Paris Example :

This is the algorithme applied on the 10 most populated cities in france. On the first map, colors fit the ratio convergence speed and they fit starting social housing ratio in the second map. The first graph represents the trajectories for every starting point : a blue vertical bar means a unit converges towards mean at this agregation level and horizontal bars reprensents boundaries.

You need to run the script from terminal. In a compiler, you just have to put path of social_segregation_France file.