esda.moran
— Moran’s I measures of spatial autocorrelation¶
New in version 1.0.
Moran’s I global and local measures of spatial autocorrelation
Moran’s I Spatial Autocorrelation Statistics

class
pysal.esda.moran.
Moran
(y, w, transformation='r', permutations=999, two_tailed=True)[source]¶ Moran’s I Global Autocorrelation Statistic
Parameters:  y (array) – variable measured across n spatial units
 w (W) – spatial weights instance
 transformation (string) – weights transformation, default is rowstandardized “r”. Other options include “B”: binary, “D”: doublystandardized, “U”: untransformed (general weights), “V”: variancestabilizing.
 permutations (int) – number of random permutations for calculation of pseudop_values
 two_tailed (boolean) – If True (default) analytical pvalues for Moran are two tailed, otherwise if False, they are onetailed.

y
¶ array – original variable

w
¶ W – original w object

permutations
¶ int – number of permutations

I
¶ float – value of Moran’s I

EI
¶ float – expected value under normality assumption

VI_norm
¶ float – variance of I under normality assumption

seI_norm
¶ float – standard deviation of I under normality assumption

z_norm
¶ float – zvalue of I under normality assumption

p_norm
¶ float – pvalue of I under normality assumption

VI_rand
¶ float – variance of I under randomization assumption

seI_rand
¶ float – standard deviation of I under randomization assumption

z_rand
¶ float – zvalue of I under randomization assumption

p_rand
¶ float – pvalue of I under randomization assumption

two_tailed
¶ boolean – If True p_norm and p_rand are twotailed, otherwise they are onetailed.

sim
¶ array – (if permutations>0) vector of I values for permuted samples

p_sim
¶ array – (if permutations>0) pvalue based on permutations (onetailed) null: spatial randomness alternative: the observed I is extreme if it is either extremely greater or extremely lower than the values obtained based on permutations

EI_sim
¶ float – (if permutations>0) average value of I from permutations

VI_sim
¶ float – (if permutations>0) variance of I from permutations

seI_sim
¶ float – (if permutations>0) standard deviation of I under permutations.

z_sim
¶ float – (if permutations>0) standardized I based on permutations

p_z_sim
¶ float – (if permutations>0) pvalue based on standard normal approximation from permutations
Examples
>>> import pysal >>> w = pysal.open(pysal.examples.get_path("stl.gal")).read() >>> f = pysal.open(pysal.examples.get_path("stl_hom.txt")) >>> y = np.array(f.by_col['HR8893']) >>> mi = Moran(y, w) >>> "%7.5f" % mi.I '0.24366' >>> mi.EI 0.012987012987012988 >>> mi.p_norm 0.00027147862770937614
SIDS example replicating OpenGeoda
>>> w = pysal.open(pysal.examples.get_path("sids2.gal")).read() >>> f = pysal.open(pysal.examples.get_path("sids2.dbf")) >>> SIDR = np.array(f.by_col("SIDR74")) >>> mi = pysal.Moran(SIDR, w) >>> "%6.4f" % mi.I '0.2477' >>> mi.p_norm 0.0001158330781489969
Onetailed
>>> mi_1 = pysal.Moran(SIDR, w, two_tailed=False) >>> "%6.4f" % mi_1.I '0.2477' >>> mi_1.p_norm 5.7916539074498452e05

classmethod
by_col
(df, cols, w=None, inplace=False, pvalue='sim', outvals=None, **stat_kws)[source]¶ Function to compute a Moran statistic on a dataframe
Parameters:  df (pandas.DataFrame) – a pandas dataframe with a geometry column
 cols (string or list of string) – name or list of names of columns to use to compute the statistic
 w (pysal weights object) – a weights object aligned with the dataframe. If not provided, this is searched for in the dataframe’s metadata
 inplace (bool) – a boolean denoting whether to operate on the dataframe inplace or to return a series contaning the results of the computation. If operating inplace, the derived columns will be named ‘column_moran’
 pvalue (string) – a string denoting which pvalue should be returned. Refer to the the Moran statistic’s documentation for available pvalues
 outvals (list of strings) – list of arbitrary attributes to return as columns from the Moran statistic
 **stat_kws (keyword arguments) – options to pass to the underlying statistic. For this, see the documentation for the Moran statistic.
Returns:  If inplace, None, and operation is conducted on dataframe in memory. Otherwise,
 returns a copy of the dataframe with the relevant columns attached.
See also
For
,refer

class
pysal.esda.moran.
Moran_Local
(y, w, transformation='r', permutations=999, geoda_quads=False)[source]¶ Local Moran Statistics
Parameters:  y (array) – (n,1), attribute array
 w (W) – weight instance assumed to be aligned with y
 transformation ({'R', 'B', 'D', 'U', 'V'}) – weights transformation, default is rowstandardized “r”. Other options include “B”: binary, “D”: doublystandardized, “U”: untransformed (general weights), “V”: variancestabilizing.
 permutations (int) – number of random permutations for calculation of pseudo p_values
 geoda_quads (boolean) – (default=False) If True use GeoDa scheme: HH=1, LL=2, LH=3, HL=4 If False use PySAL Scheme: HH=1, LH=2, LL=3, HL=4

y
¶ array – original variable

w
¶ W – original w object

permutations
¶ int – number of random permutations for calculation of pseudo p_values

Is
¶ array – local Moran’s I values

q
¶ array – (if permutations>0) values indicate quandrant location 1 HH, 2 LH, 3 LL, 4 HL

sim
¶ array (permutations by n) – (if permutations>0) I values for permuted samples

p_sim
¶ array – (if permutations>0) pvalues based on permutations (onesided) null: spatial randomness alternative: the observed Ii is further away or extreme from the median of simulated values. It is either extremelyi high or extremely low in the distribution of simulated Is.

EI_sim
¶ array – (if permutations>0) average values of local Is from permutations

VI_sim
¶ array – (if permutations>0) variance of Is from permutations

seI_sim
¶ array – (if permutations>0) standard deviations of Is under permutations.

z_sim
¶ arrray – (if permutations>0) standardized Is based on permutations

p_z_sim
¶ array – (if permutations>0) pvalues based on standard normal approximation from permutations (onesided) for twosided tests, these values should be multiplied by 2
Examples
>>> import pysal as ps >>> import numpy as np >>> np.random.seed(10) >>> w = ps.open(ps.examples.get_path("desmith.gal")).read() >>> f = ps.open(ps.examples.get_path("desmith.txt")) >>> y = np.array(f.by_col['z']) >>> lm = ps.Moran_Local(y, w, transformation = "r", permutations = 99) >>> lm.q array([4, 4, 4, 2, 3, 3, 1, 4, 3, 3]) >>> lm.p_z_sim[0] 0.24669152541631179 >>> lm = ps.Moran_Local(y, w, transformation = "r", permutations = 99, geoda_quads=True) >>> lm.q array([4, 4, 4, 3, 2, 2, 1, 4, 2, 2])
Note random components result is slightly different values across architectures so the results have been removed from doctests and will be moved into unittests that are conditional on architectures

classmethod
by_col
(df, cols, w=None, inplace=False, pvalue='sim', outvals=None, **stat_kws)[source]¶ Function to compute a Moran_Local statistic on a dataframe
Parameters:  df (pandas.DataFrame) – a pandas dataframe with a geometry column
 cols (string or list of string) – name or list of names of columns to use to compute the statistic
 w (pysal weights object) – a weights object aligned with the dataframe. If not provided, this is searched for in the dataframe’s metadata
 inplace (bool) – a boolean denoting whether to operate on the dataframe inplace or to return a series contaning the results of the computation. If operating inplace, the derived columns will be named ‘column_moran_local’
 pvalue (string) – a string denoting which pvalue should be returned. Refer to the the Moran_Local statistic’s documentation for available pvalues
 outvals (list of strings) – list of arbitrary attributes to return as columns from the Moran_Local statistic
 **stat_kws (keyword arguments) – options to pass to the underlying statistic. For this, see the documentation for the Moran_Local statistic.
Returns:  If inplace, None, and operation is conducted on dataframe in memory. Otherwise,
 returns a copy of the dataframe with the relevant columns attached.
See also
For
,refer

class
pysal.esda.moran.
Moran_BV
(x, y, w, transformation='r', permutations=999)[source]¶ Bivariate Moran’s I
Parameters:  x (array) – xaxis variable
 y (array) – wy will be on y axis
 w (W) – weight instance assumed to be aligned with y
 transformation ({'R', 'B', 'D', 'U', 'V'}) – weights transformation, default is rowstandardized “r”. Other options include “B”: binary, “D”: doublystandardized, “U”: untransformed (general weights), “V”: variancestabilizing.
 permutations (int) – number of random permutations for calculation of pseudo p_values

zx
¶ array – original x variable standardized by mean and std

zy
¶ array – original y variable standardized by mean and std

w
¶ W – original w object

permutation
¶ int – number of permutations

I
¶ float – value of bivariate Moran’s I

sim
¶ array – (if permutations>0) vector of I values for permuted samples

p_sim
¶ float – (if permutations>0) pvalue based on permutations (onesided) null: spatial randomness alternative: the observed I is extreme it is either extremely high or extremely low

EI_sim
¶ array – (if permutations>0) average value of I from permutations

VI_sim
¶ array – (if permutations>0) variance of I from permutations

seI_sim
¶ array – (if permutations>0) standard deviation of I under permutations.

z_sim
¶ array – (if permutations>0) standardized I based on permutations

p_z_sim
¶ float – (if permutations>0) pvalue based on standard normal approximation from permutations
Notes
Inference is only based on permutations as analytical results are none too reliable.
Examples
>>> import pysal >>> import numpy as np
Set random number generator seed so we can replicate the example
>>> np.random.seed(10)
Open the sudden infant death dbf file and read in rates for 74 and 79 converting each to a numpy array
>>> f = pysal.open(pysal.examples.get_path("sids2.dbf")) >>> SIDR74 = np.array(f.by_col['SIDR74']) >>> SIDR79 = np.array(f.by_col['SIDR79'])
Read a GAL file and construct our spatial weights object
>>> w = pysal.open(pysal.examples.get_path("sids2.gal")).read()
Create an instance of Moran_BV
>>> mbi = Moran_BV(SIDR79, SIDR74, w)
What is the bivariate Moran’s I value
>>> print mbi.I 0.156131961696
Based on 999 permutations, what is the pvalue of our statistic
>>> mbi.p_z_sim 0.0014186617421765302

classmethod
by_col
(df, x, y=None, w=None, inplace=False, pvalue='sim', outvals=None, **stat_kws)[source]¶ Function to compute a Moran_BV statistic on a dataframe
Parameters:  df (pandas.DataFrame) – a pandas dataframe with a geometry column
 X (list of strings) – column name or list of column names to use as X values to compute the bivariate statistic. If no Y is provided, pairwise comparisons among these variates are used instead.
 Y (list of strings) – column name or list of column names to use as Y values to compute the bivariate statistic. if no Y is provided, pariwise comparisons among the X variates are used instead.
 w (pysal weights object) – a weights object aligned with the dataframe. If not provided, this is searched for in the dataframe’s metadata
 inplace (bool) – a boolean denoting whether to operate on the dataframe inplace or to return a series contaning the results of the computation. If operating inplace, the derived columns will be named ‘column_moran_local’
 pvalue (string) – a string denoting which pvalue should be returned. Refer to the the Moran_BV statistic’s documentation for available pvalues
 outvals (list of strings) – list of arbitrary attributes to return as columns from the Moran_BV statistic
 **stat_kws (keyword arguments) – options to pass to the underlying statistic. For this, see the documentation for the Moran_BV statistic.
Returns:  If inplace, None, and operation is conducted on dataframe in memory. Otherwise,
 returns a copy of the dataframe with the relevant columns attached.
See also
For
,refer

pysal.esda.moran.
Moran_BV_matrix
(variables, w, permutations=0, varnames=None)[source]¶ Bivariate Moran Matrix
Calculates bivariate Moran between all pairs of a set of variables.
Parameters: Returns: results – (i, j) is the key for the pair of variables, values are the Moran_BV objects.
Return type: dictionary
Examples
>>> import pysal
open dbf
>>> f = pysal.open(pysal.examples.get_path("sids2.dbf"))
pull of selected variables from dbf and create numpy arrays for each
>>> varnames = ['SIDR74', 'SIDR79', 'NWR74', 'NWR79'] >>> vars = [np.array(f.by_col[var]) for var in varnames]
create a contiguity matrix from an external gal file
>>> w = pysal.open(pysal.examples.get_path("sids2.gal")).read()
create an instance of Moran_BV_matrix
>>> res = Moran_BV_matrix(vars, w, varnames = varnames)
check values
>>> print round(res[(0, 1)].I,7) 0.1936261 >>> print round(res[(3, 0)].I,7) 0.3770138

class
pysal.esda.moran.
Moran_Local_BV
(x, y, w, transformation='r', permutations=999, geoda_quads=False)[source]¶ Bivariate Local Moran Statistics
Parameters:  x (array) – xaxis variable
 y (array) – (n,1), wy will be on y axis
 w (W) – weight instance assumed to be aligned with y
 transformation ({'R', 'B', 'D', 'U', 'V'}) – weights transformation, default is rowstandardized “r”. Other options include “B”: binary, “D”: doublystandardized, “U”: untransformed (general weights), “V”: variancestabilizing.
 permutations (int) – number of random permutations for calculation of pseudo p_values
 geoda_quads (boolean) – (default=False) If True use GeoDa scheme: HH=1, LL=2, LH=3, HL=4 If False use PySAL Scheme: HH=1, LH=2, LL=3, HL=4

zx
¶ array – original x variable standardized by mean and std

zy
¶ array – original y variable standardized by mean and std

w
¶ W – original w object

permutations
¶ int – number of random permutations for calculation of pseudo p_values

Is
¶ float – value of Moran’s I

q
¶ array – (if permutations>0) values indicate quandrant location 1 HH, 2 LH, 3 LL, 4 HL

sim
¶ array – (if permutations>0) vector of I values for permuted samples

p_sim
¶ array – (if permutations>0) pvalue based on permutations (onesided) null: spatial randomness alternative: the observed Ii is further away or extreme from the median of simulated values. It is either extremelyi high or extremely low in the distribution of simulated Is.

EI_sim
¶ array – (if permutations>0) average values of local Is from permutations

VI_sim
¶ array – (if permutations>0) variance of Is from permutations

seI_sim
¶ array – (if permutations>0) standard deviations of Is under permutations.

z_sim
¶ arrray – (if permutations>0) standardized Is based on permutations

p_z_sim
¶ array – (if permutations>0) pvalues based on standard normal approximation from permutations (onesided) for twosided tests, these values should be multiplied by 2
Examples
>>> import pysal as ps >>> import numpy as np >>> np.random.seed(10) >>> w = ps.open(ps.examples.get_path("sids2.gal")).read() >>> f = ps.open(ps.examples.get_path("sids2.dbf")) >>> x = np.array(f.by_col['SIDR79']) >>> y = np.array(f.by_col['SIDR74']) >>> lm = ps.Moran_Local_BV(x, y, w, transformation = "r", permutations = 99) >>> lm.q[:10] array([3, 4, 3, 4, 2, 1, 4, 4, 2, 4]) >>> lm.p_z_sim[0] 0.0017240031348827456 >>> lm = ps.Moran_Local_BV(x, y, w, transformation = "r", permutations = 99, geoda_quads=True) >>> lm.q[:10] array([2, 4, 2, 4, 3, 1, 4, 4, 3, 4])
Note random components result is slightly different values across architectures so the results have been removed from doctests and will be moved into unittests that are conditional on architectures

classmethod
by_col
(df, x, y=None, w=None, inplace=False, pvalue='sim', outvals=None, **stat_kws)[source]¶ Function to compute a Moran_Local_BV statistic on a dataframe
Parameters:  df (pandas.DataFrame) – a pandas dataframe with a geometry column
 X (list of strings) – column name or list of column names to use as X values to compute the bivariate statistic. If no Y is provided, pairwise comparisons among these variates are used instead.
 Y (list of strings) – column name or list of column names to use as Y values to compute the bivariate statistic. if no Y is provided, pariwise comparisons among the X variates are used instead.
 w (pysal weights object) – a weights object aligned with the dataframe. If not provided, this is searched for in the dataframe’s metadata
 inplace (bool) – a boolean denoting whether to operate on the dataframe inplace or to return a series contaning the results of the computation. If operating inplace, the derived columns will be named ‘column_moran_local_bv’
 pvalue (string) – a string denoting which pvalue should be returned. Refer to the the Moran_Local_BV statistic’s documentation for available pvalues
 outvals (list of strings) – list of arbitrary attributes to return as columns from the Moran_Local_BV statistic
 **stat_kws (keyword arguments) – options to pass to the underlying statistic. For this, see the documentation for the Moran_Local_BV statistic.
Returns:  If inplace, None, and operation is conducted on dataframe in memory. Otherwise,
 returns a copy of the dataframe with the relevant columns attached.
See also
For
,refer

class
pysal.esda.moran.
Moran_Rate
(e, b, w, adjusted=True, transformation='r', permutations=999, two_tailed=True)[source]¶ Adjusted Moran’s I Global Autocorrelation Statistic for Rate Variables [Assuncao1999]
Parameters:  e (array) – an event variable measured across n spatial units
 b (array) – a populationatrisk variable measured across n spatial units
 w (W) – spatial weights instance
 adjusted (boolean) – whether or not Moran’s I needs to be adjusted for rate variable
 transformation ({'R', 'B', 'D', 'U', 'V'}) – weights transformation, default is rowstandardized “r”. Other options include “B”: binary, “D”: doublystandardized, “U”: untransformed (general weights), “V”: variancestabilizing.
 two_tailed (boolean) – If True (default), analytical pvalues for Moran’s I are twotailed, otherwise they are one tailed.
 permutations (int) – number of random permutations for calculation of pseudo p_values

y
¶ array – rate variable computed from parameters e and b if adjusted is True, y is standardized rates otherwise, y is raw rates

w
¶ W – original w object

permutations
¶ int – number of permutations

I
¶ float – value of Moran’s I

EI
¶ float – expected value under normality assumption

VI_norm
¶ float – variance of I under normality assumption

seI_norm
¶ float – standard deviation of I under normality assumption

z_norm
¶ float – zvalue of I under normality assumption

p_norm
¶ float – pvalue of I under normality assumption

VI_rand
¶ float – variance of I under randomization assumption

seI_rand
¶ float – standard deviation of I under randomization assumption

z_rand
¶ float – zvalue of I under randomization assumption

p_rand
¶ float – pvalue of I under randomization assumption

two_tailed
¶ boolean – If True, p_norm and p_rand are twotailed pvalues, otherwise they are onetailed.

sim
¶ array – (if permutations>0) vector of I values for permuted samples

p_sim
¶ array – (if permutations>0) pvalue based on permutations (onesided) null: spatial randomness alternative: the observed I is extreme if it is either extremely greater or extremely lower than the values obtained from permutaitons

EI_sim
¶ float – (if permutations>0) average value of I from permutations

VI_sim
¶ float – (if permutations>0) variance of I from permutations

seI_sim
¶ float – (if permutations>0) standard deviation of I under permutations.

z_sim
¶ float – (if permutations>0) standardized I based on permutations

p_z_sim
¶ float – (if permutations>0) pvalue based on standard normal approximation from
Examples
>>> import pysal >>> w = pysal.open(pysal.examples.get_path("sids2.gal")).read() >>> f = pysal.open(pysal.examples.get_path("sids2.dbf")) >>> e = np.array(f.by_col('SID79')) >>> b = np.array(f.by_col('BIR79')) >>> mi = pysal.esda.moran.Moran_Rate(e, b, w, two_tailed=False) >>> "%6.4f" % mi.I '0.1662' >>> "%6.4f" % mi.p_norm '0.0042'

classmethod
by_col
(df, events, populations, w=None, inplace=False, pvalue='sim', outvals=None, swapname='', **stat_kws)[source]¶ Function to compute a Moran_Rate statistic on a dataframe
Parameters:  df (pandas.DataFrame) – a pandas dataframe with a geometry column
 events (string or list of strings) – one or more names where events are stored
 populations (string or list of strings) – one or more names where the populations corresponding to the events are stored. If one population column is provided, it is used for all event columns. If more than one population column is provided but there is not a population for every event column, an exception will be raised.
 w (pysal weights object) – a weights object aligned with the dataframe. If not provided, this is searched for in the dataframe’s metadata
 inplace (bool) – a boolean denoting whether to operate on the dataframe inplace or to return a series contaning the results of the computation. If operating inplace, the derived columns will be named ‘column_moran_rate’
 pvalue (string) – a string denoting which pvalue should be returned. Refer to the the Moran_Rate statistic’s documentation for available pvalues
 outvals (list of strings) – list of arbitrary attributes to return as columns from the Moran_Rate statistic
 **stat_kws (keyword arguments) – options to pass to the underlying statistic. For this, see the documentation for the Moran_Rate statistic.
Returns:  If inplace, None, and operation is conducted on dataframe in memory. Otherwise,
 returns a copy of the dataframe with the relevant columns attached.
See also
For
,refer

class
pysal.esda.moran.
Moran_Local_Rate
(e, b, w, adjusted=True, transformation='r', permutations=999, geoda_quads=False)[source]¶ Adjusted Local Moran Statistics for Rate Variables [Assuncao1999]
Parameters:  e (array) – (n,1), an event variable across n spatial units
 b (array) – (n,1), a populationatrisk variable across n spatial units
 w (W) – weight instance assumed to be aligned with y
 adjusted (boolean) – whether or not local Moran statistics need to be adjusted for rate variable
 transformation ({'R', 'B', 'D', 'U', 'V'}) – weights transformation, default is rowstandardized “r”. Other options include “B”: binary, “D”: doublystandardized, “U”: untransformed (general weights), “V”: variancestabilizing.
 permutations (int) – number of random permutations for calculation of pseudo p_values
 geoda_quads (boolean) – (default=False) If True use GeoDa scheme: HH=1, LL=2, LH=3, HL=4 If False use PySAL Scheme: HH=1, LH=2, LL=3, HL=4

y
¶ array – rate variables computed from parameters e and b if adjusted is True, y is standardized rates otherwise, y is raw rates

w
¶ W – original w object

permutations
¶ int – number of random permutations for calculation of pseudo p_values

I
¶ float – value of Moran’s I

q
¶ array – (if permutations>0) values indicate quandrant location 1 HH, 2 LH, 3 LL, 4 HL

sim
¶ array – (if permutations>0) vector of I values for permuted samples

p_sim
¶ array – (if permutations>0) pvalue based on permutations (onesided) null: spatial randomness alternative: the observed Ii is further away or extreme from the median of simulated Iis. It is either extremely high or extremely low in the distribution of simulated Is

EI_sim
¶ float – (if permutations>0) average value of I from permutations

VI_sim
¶ float – (if permutations>0) variance of I from permutations

seI_sim
¶ float – (if permutations>0) standard deviation of I under permutations.

z_sim
¶ float – (if permutations>0) standardized I based on permutations

p_z_sim
¶ float – (if permutations>0) pvalue based on standard normal approximation from permutations (onesided) for twosided tests, these values should be multiplied by 2
Examples
>>> import pysal as ps >>> import numpy as np >>> np.random.seed(10) >>> w = ps.open(ps.examples.get_path("sids2.gal")).read() >>> f = ps.open(ps.examples.get_path("sids2.dbf")) >>> e = np.array(f.by_col('SID79')) >>> b = np.array(f.by_col('BIR79')) >>> lm = ps.esda.moran.Moran_Local_Rate(e, b, w, transformation = "r", permutations = 99) >>> lm.q[:10] array([2, 4, 3, 1, 2, 1, 1, 4, 2, 4]) >>> lm.p_z_sim[0] 0.39319552026912641 >>> lm = ps.esda.moran.Moran_Local_Rate(e, b, w, transformation = "r", permutations = 99, geoda_quads=True) >>> lm.q[:10] array([3, 4, 2, 1, 3, 1, 1, 4, 3, 4])
Note random components result is slightly different values across architectures so the results have been removed from doctests and will be moved into unittests that are conditional on architectures

classmethod
by_col
(df, events, populations, w=None, inplace=False, pvalue='sim', outvals=None, swapname='', **stat_kws)[source]¶ Function to compute a Moran_Local_Rate statistic on a dataframe
Parameters:  df (pandas.DataFrame) – a pandas dataframe with a geometry column
 events (string or list of strings) – one or more names where events are stored
 populations (string or list of strings) – one or more names where the populations corresponding to the events are stored. If one population column is provided, it is used for all event columns. If more than one population column is provided but there is not a population for every event column, an exception will be raised.
 w (pysal weights object) – a weights object aligned with the dataframe. If not provided, this is searched for in the dataframe’s metadata
 inplace (bool) – a boolean denoting whether to operate on the dataframe inplace or to return a series contaning the results of the computation. If operating inplace, the derived columns will be named ‘column_moran_local_rate’
 pvalue (string) – a string denoting which pvalue should be returned. Refer to the the Moran_Local_Rate statistic’s documentation for available pvalues
 outvals (list of strings) – list of arbitrary attributes to return as columns from the Moran_Local_Rate statistic
 **stat_kws (keyword arguments) – options to pass to the underlying statistic. For this, see the documentation for the Moran_Local_Rate statistic.
Returns:  If inplace, None, and operation is conducted on dataframe in memory. Otherwise,
 returns a copy of the dataframe with the relevant columns attached.
See also
For
,refer