Questions tagged [pandas]

pandas is an open source, BSD-licensed library providing high-performance, easy-to-use data structures and data analysis tools for the Python programming language.

Filter by
Sorted by
Tagged with
0
votes
0answers
21 views

Convert KMZ / KML to Data Frame in Python using GeoPandas and Fiona, or XML [closed]

I am trying to convert this KMZ file: https://ulstercountyny.gov/sites/default/files/gis-data/Tax_Parcels_202109.kmz ... into a data frame in python for data analysis. Have tried using GeoPandas and ...
0
votes
0answers
27 views

ArcGIS Python API - FeatureLayer set CRS

I'm loading a layer from ArcGIS with the ArcGIS Python API: from arcgis.features import FeatureLayer layer=FeatureLayer(lyr_url) Then I make it a pandas dataframe and then move it to Geodataframe as ...
0
votes
1answer
28 views

Adding column in a GeoDataFrame with the SRID of each geometry?

I'm merging a list of shapefiles with this code: from pathlib import Path import pandas import geopandas from tqdm import tqdm folder = Path(r"read path") shapefiles = folder.glob("...
2
votes
0answers
22 views

Naming or extracting segments as geometrical objects from polygons

I have this little issue that I can't really make a good solution for. I have this dataframe: index id x_polygon y_polygon \ 0 0 168bb0ea-3748-42ad-84c3-...
1
vote
0answers
38 views

Why count() doesn't work but size() does in Pandas? [closed]

I have a point and a polygon data and in this line I'm simply making a spatial join and group its output to count incidents per area. Currently this line works but I don't understand why it works. I ...
1
vote
1answer
63 views

Subsetting a Pandas dataframe based on latitude and longitude values and coordinates of a circular boundary in Python

I have a dataset with coordinates (LAT and LON) and boundary coordinates of a circle (shown in the figure below). I want to subset a dataset based on coordinates of this circular boundary for getting ...
1
vote
2answers
118 views

Extracting points from a (FIRMS)Google Earth Engine layer in Python

My goal is to extract data from FIRMS to further analyze it in a tabular data format. How can I extract those orange marks that indicate fire? Can I output them as a CSV or a pandas dataframe? I would ...
3
votes
1answer
207 views

Pandas DataFrame to GeoDataFrame with Polygon geometry using groupby and lambda

I have a pandas DataFrame like this name loc_x loc_y grp_name a1 1.0 2.0 set1 a2 2.0 3.0 set1 a3 3.2 4.1 set2 a4 7.9 4.2 ...
1
vote
1answer
86 views

Converting text file into GeoJSON using Python

I'm trying to take in a txt-file and convert it into data for a GeoJSON dataset with these values. I used this piece of code from this article: Pandas to GeoJSON (Multiples points + features) with ...
3
votes
1answer
485 views

Parsing/converting ISO 8601 datetime fields using pandas

I have a datetime field in a Pandas dataframe that becomes problematic when using ArcGIS Pro to load data from a csv to a table on ArcSDE. The field in Pandas looks like this: 2007-02-01T05:00:00....
0
votes
1answer
52 views

Update cursor with nested dictionary with ArcPy

I'm trying to update a mosaic dataset tables attributes with values from a CSV. The CSV and dataset share a field that uniquely identifies each record, and all of the fields to update have exactly the ...
1
vote
1answer
71 views

Why are columns in a GeoDataFrame supposedly 'missing" when the set_index method is called?

I am trying to use the NetworkX package in Python to find the shortest route between two points along a road network. Rather than straight lines between nodes in the road network, I need my script to ...
1
vote
0answers
25 views

Extract time series from CFSV2 Google Earth Engine Python

I'm trying to export to a dataframe the time series of the CFS model for the maximum temperature since 2000 for any latitude/longitude, but I have a Time Out problem. So, I tried a for each year and ...
3
votes
1answer
76 views

Detecting intersection points which lay within U-shape using ArcPy

I have three shapefiles: the first is a line the second contains a polygon and the third contains all intersections points of the shapefiles. I have written an algorithm that adds the length of the ...
1
vote
1answer
31 views

Matching/Joining Photos to two fields and a fuzzy time

I have a directory with around 100,000 images sorted by the crew that took the photo and the time it was uploaded. I also have a master spreadsheet with the dates the images were taken, the camera's ...
0
votes
1answer
23 views

Points within buffer with the same id

I have a buffer layer and a point layer: buffer_gdf ID 0 1A 1 1B 2 1C and point_gdf ID 0 1A 1 1A 2 1A 3 1A 4 1A 5 1B 6 1B 7 1B 8 1B 9 1B ...
0
votes
0answers
69 views

Fiona Saving Gives DriverIOError

I have a script that I used before to clip polygons. I modified it a touch to use in another place, but am running into a fiona.errors.DriverIOError. As far as I can tell, all the code is working ...
1
vote
2answers
451 views

Attribute Table into pandas DataFrame-PyQGIS

I'm trying to develop a plugin in QGIS. My issue is that I don't know how to transform an attribute table into a dataframe in order to use it further in run(self) function later. I also used a ...
-1
votes
1answer
57 views

How to solve error when querying the .shp file to Excel?

I am making a Python code with geopandas and xlwings, what I do is colsulse .shp files from Excel, it works fine but when it reaches the last line of the code wb.save (in_file) where it should be ...
1
vote
0answers
149 views

Geometry not recognized as such even though it is

I have a GeoDataFrame in which the geometry column consists of polygons. Zones = id geometry 0 A1 POLYGON ((119.82334 28.35047, 119.79008 28.350... 1 ...
0
votes
0answers
55 views

Edits to a spatial dataframe dont carry over when exporting to a featureclass in ArcPy, why?

I created a spatial dataframe from a featureclass. Then I edited the spatial dataframe, and exported it back to a featureclass. I was expecting the attribute table of the featureclass to keep the ...
2
votes
1answer
71 views

How can I create a Choropleth by combining a polygon GeoPanda with a point GeoPanda?

I have two GeoPanda dataframes, one with the location of shops with point coordinates in the geometry column, and one with London boroughs with polygons in the geometry column. My usual approach with ...
0
votes
0answers
35 views

Spliting the column in CSV its showing attribute Error in QGIS plugin

I am trying create a new plugin in QGIS. I have my own script its work in normal Jupyter Notebook, then I planned to convert into as QGIS Plugin.The dout/error occur while spliting the columns. ...
0
votes
1answer
586 views

Get errors in GeoPy with Python when I load large size data

I have data size 1.87GB contain 14962000 rows and 9 columns. And I want to apply geopy but I got the errors. my code: import pandas as pd from geopy.geocoders import Nominatim from geopy.extra....
5
votes
1answer
1k views

Shapely coordinate sequence to GeoDataFrame

Using the shapely bounding box function box, and a GeoDataFrameof points, I have extracted a bounding box and created a buffer around it (below gdf is a GeoDataFrameof points): bbox=shapely.geometry....
0
votes
0answers
43 views

Exporting pandas dataframe as shapefile using ArcPy gives ERROR 000732

I'm trying to export my dataframe as a CSV file and as a shapefile. I'm able to export it as a CSV but get the following error on the last line: ERROR 000732: Input Features: Dataset in_memory\...
0
votes
0answers
26 views

Converting ArcPy fieldmap to pandas dataframe

I want to get a "snapshot" of a fieldMapping / FieldMap. How do I convert it to a pandas dataframe? My current approach is to fieldList = arcpy.ListFields(theFeatureClass) extracted = [] ...
1
vote
0answers
74 views

Creating a code that computes the distance between two properties given northings and eastings

I was given a file with different properties in different sheets containing coordinates for each corners. I need to create a program that computes the distance between two lots. I'm not sure how to ...
1
vote
0answers
50 views

Getting error while trying to read multipolygon data using shapely wkt.loads (Python)

I have a CSV file from which I'm trying to read multipolygons using wkt.loads of shapely. While this works: from shapely import wkt x='MULTIPOLYGON(((18.62981086588664 73.79447461830097,18....
1
vote
1answer
183 views

Array memory error when reading rasters

I'm attempting to make a spatio-temporal statistics analysis on a few chunks of data using rasterstats, rasterio and pandas/geopandas on Python. # create dataframes for areas of interest and specify ...
0
votes
2answers
336 views

Combine multiple rows in a CSV using Pandas

I have over a hundred CSV files that I will join with selections of a shapefile to represent visually in QGIS. However, in these CSV files, the data is sometimes split into rows of 1A and 1B, or 13A ...
1
vote
1answer
31 views

Geopandas Points within Polygon; Is there a method to convert bool series result into a python list?

Working in Linux OS with Visual Studio Code; Jupyter Notebook module. import geopandas as gpd ubp1 = "/media/rg/data/map/urban boundary.geojson" poly1 = gpd.read_file(ubp1) import shapely....
2
votes
2answers
80 views

Selecting attributes by coordinates from DataFrame in Python

I wonder how to return the right information needed from this df. Currently I get an empty return. I think the problem is my selection because the coordinates are correct and all variables are as well....
0
votes
1answer
288 views

How to plot coordinate system from EPSG 4326 on north pole centered map in Python?

I have the following pandas dataframe (df) which looks like this with column headers and data values, 3 points each: temperature: array([-101.6015625, -100.9296875, -85.4296875]) latitude: array([32....
3
votes
1answer
287 views

Return Geometry in a Pandas Dataframe Google Earth Engine

I have found some sample code that returns features from a GEE image to a pandas dataframe based on specific points in my feature collection. The challenge is I need the geometry on these points to be ...
0
votes
0answers
90 views

FutureWarning: Sorting because non-concatenation axis is not aligned. Converting a Google Earth Engine Dataset into a Pandas/Geopandas Dataframe

I am trying to get a pandas or geopandas dataframe returned from a Google Earth Engine FeatureCollection for specific point data. Basically like a spatial intersect where all values from the feature ...
1
vote
0answers
24 views

How to speed up a complex process of compositing multispectral images in python?

I would like to speed up my process. I have a one month time series which consists of 5 images (Sentinel-2) taken over several days. Each image is made up of the same bands that I selected. After ...
1
vote
1answer
254 views

How to split a single polyline shapefile into many shapefiles based on unique value using GeoPandas?

I have a single polyline shapefile with multiple features (row). I want to export each row to separate shapefile with using GeoPandas. But I got Geometry error in the code. This is my shapefile: and ...
1
vote
1answer
48 views

Convert the time to the suitable format using Pandas [closed]

I have a file whose name is "MCD43A3_Alb_QA_SWIR_2020_061.tif", and I want to split the time "2020_061" and convert to the format "2020-03-01", how can I do that? Here is ...
1
vote
0answers
345 views

Getting the center point of a cluster in Pandas

I have a list of of coordinates that have areas mapped out as follows import pandas as pd import numpy as np import folium from folium import plugins from folium.plugins import HeatMap import pyodbc ...
1
vote
1answer
986 views

Contextily add_basemap uses wrong extent and zoom level

I'm trying to add a contextily basemap to a Matplotlib figure containing a GeoPandas data frame. When I just plot the data frame using df.plot the map extent is calculated correctly. However, when I ...
8
votes
2answers
3k views

Quick way to get WKT from a GeoDataFrame's geometries in GeoPandas?

Is there a quick way to produce a column/series containing the WKTs of all the geometries in a GeoPandas GeoDataFrame? I got around this using the apply function (see example below), but I just ...
2
votes
1answer
3k views

Mapping multiple polygons on Folium

I have a list of of coordinates that have areas mapped out on a map Zone zone_name users distinct_users geometry 1 A 635 51 POLYGON ((13.05584728590942 77....
1
vote
2answers
681 views

Converting a column with coordinates in Pandas to GeoPandas

I have a list of of coordinates that have areas mapped out on a map zones coordinates 1 [[13.055847285909415, 77.47638480859382], [13.04673679588868, 77.50519132714851], [13.03294330911764, 77....
0
votes
0answers
811 views

Fixing a corrupted geometry column with Python GeoPandas

I had a shapefile which I converted to a geodataframe, and created a geometry column. I did some manipulation with it in pandas. I am now trying to convert it back into a geodataframe and eventually a ...
1
vote
2answers
290 views

Preserve coordinates when converting TIFF image to numpy ndarray

I have satellite image that I want to convert into numy array (and then to Pandas). I already know how to do that thanks to Stefan, but th eproblem is that it does not preserve the coordinate data. ...
0
votes
0answers
51 views

GeoPandas plot range problem

I read a .csv file with geometry like this: trajs = pd.read_csv("trajs.csv") trajs["geom"] = trajs["geom"].apply(wkt.loads) trajs = gpd.GeoDataFrame(trajs, geometry="...
1
vote
0answers
62 views

random forest image classfication on python

I am new to python, I would like to do a rf classification on an multispectral image which I applied the PCA. After applying acp on different bands including NDVI I got negative values, after that my ...
1
vote
0answers
22 views

Trying to run TransitFlow/Processing and I'm getting an error

I just installed TransitFlow and Preprocessing after following this link : https://github.com/transitland/transitland-processing-animation and I run this line of code : python transitflow.py --name=...
1
vote
0answers
201 views

Adding a table to a web map made in Folium [closed]

I have made a nice Folium map however, the amount of data is small, but increasing. Right now it is grabbing a wildfire perimeter GeoJSON from NIFC and then getting points from my organization and ...