2
votes
Accepted
rio.to_raster returns ValueError: cannot convert float NaN to integer
Adjust this line in your code and it works
grid = make_geocube(vector_data=points, measurements=['some_value'], resolution=(1, 1), fill = -9999)
Reason being that nodata management is still a bit ...
2
votes
Accepted
Create multiband raster in Python from X, Y
You're doing a lot of unnecessary looping. You can create your random values in a single array and you don't need a dataframe.
import numpy as np
import rasterio as rio
from rasterio.transform import ...
1
vote
Accepted
Create filtered file out of overlapping coordinates
If the coordinates are exactly the same in both dataframes (same number of decimal places etc.), use merge with how="inner", to find the matching rows:
Merge DataFrame or named Series ...
1
vote
Colorizing polygons based on a user-defined color scheme determined by the column value
You make a geopandas data frame based on your 'states.shp' file, and a pandas data frame from your 'population_density.csv' file. Out of that big geopandas data frame you could make a smaller one, ...
1
vote
df.spatial.to_featureclass produces an empty shapefile
I can't reproduce your error in ArcGis Pro 3.2.
1
vote
Accepted
Merging a DataFrame with a GeoDataFrame based on two keys
You have no column named NAME in your right df, that is why you get KeyError. Use left_on and right_on to specify both column names:
import pandas as pd
import geopandas as gpd
df = pd.DataFrame(data=...
Only top scored, non community-wiki answers of a minimum length are eligible
Related Tags
pandas × 267python × 178
geopandas × 121
arcpy × 36
shapely × 27
arcgis-pro × 15
numpy × 15
qgis × 14
arcgis-python-api × 12
shapefile × 11
csv × 11
data-frame × 11
pyqgis × 10
fiona × 10
geodataframe × 10
rasterio × 9
folium × 9
geojson × 8
installation × 8
raster × 7
geopy × 7
postgis × 6
coordinate-system × 6
google-earth-engine × 6
coordinates × 6