Skip to content

zero-size array Erro in OrdinaryKriging #280

@jsbluekitty

Description

@jsbluekitty

I meet a erro like this when i use OrdinaryKriging()
zero-size array to reduction operation maximum which has no identity

My code looks like this:

Data = geopandas.read_file('./housepricepoi.shp').to_crs('EPSG:4547')

lons = Data['geometry'].x.values
lons = np.nan_to_num(lons)

lats = Data['geometry'].y.values
lats = np.nan_to_num(lats)

price = Data['price'].values
price = np.nan_to_num(price)

try:
    ok3d = OrdinaryKriging(lons, lats, price, variogram_model='linear')
    k3d1, ss3d = ok3d.execute("grid", grid_lon, grid_lat)
except Exception as e:
    print(e)

The info of data is like:

<class 'geopandas.geodataframe.GeoDataFrame'>
RangeIndex: 9920 entries, 0 to 9919
Data columns (total 2 columns):
 #   Column    Non-Null Count  Dtype   
---  ------    --------------  -----   
 0   price     9920 non-null   int64   
 1   geometry  9920 non-null   geometry
dtypes: geometry(1), int64(1)
memory usage: 155.1 KB

I wonder if it's my data that's causing the problem
if you want the data,i will send it to your email.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions