import numpy as np
from pysal.lib import weights
import pandas as pd
import shapely as sp
import contextily as ctx
import geopandas as gpd
import networkx as nx
import matplotlib.pyplot as plt
import esda
from splot.esda import plot_moran, lisa_cluster
from pysal.model import spregSpatial Statistics
Spatial statistics
Outline for this part: - Graphs & spatial weight matrices - Spatial autocorrelation - Standard geographic regression models
constituencies_shapes = gpd.read_file("./data/constituencies_shape/circonscriptions_legislatives_030522.shp")
constituencies_shapes = constituencies_shapes[~constituencies_shapes["id_circo"].str.startswith("97")]
constituencies_shapes.explore()Make this Notebook Trusted to load map: File -> Trust Notebook