Skip to main content

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
2 answers
69 views

How to round or limit the number of decimals in geodataframe

I need to limit or round decimals in my GeoDataFrame so that when importing to a shapefile and opening a file in QGIS, the number of decimals remains the same as in the dataframe. In GDF looks like: ...
Ilya's user avatar
  • 13
0 votes
1 answer
52 views

How to return subtype and domain description instead of the code, when using arcgis.gis Python

I am working on some Python that takes an attribute table and makes a pandas df from it. I am doing this by creating an empty list, and looping through each record of the attribute table and making a ...
Wes's user avatar
  • 11
1 vote
1 answer
70 views

rio.to_raster returns ValueError: cannot convert float NaN to integer

Maybe this is more like a Pandas question but when I try to write an xarray to a raster using rio.to_raster() I get a ValueError in Python. If I don't convert the type of xarray to int16 (this is a ...
Andrei Niță's user avatar
0 votes
1 answer
78 views

Overwriting hosted table in ArcGIS Online with CSV file from Pandas dataframe in Python

I have a script that I'm using to sort through a very large feature layer with thousands of records and create a summary table of them by type. It also calculates the count of records of the last 5 ...
Fred Mitchell's user avatar
1 vote
1 answer
46 views

Create filtered file out of overlapping coordinates

I have two CSV files with multiple columns of data (csv_1 and csv_2) which I have as Panda dataframes in Python as cal and pog. They both contain an 'x' and a 'y' column. I want to make a new dataset ...
Ark Lomas's user avatar
  • 127
2 votes
2 answers
84 views

Colorizing polygons based on a user-defined color scheme determined by the column value

I have a shapefile, and the population density for each polygon is provided in a separate CSV file.I would like to assign colors to each polygon based on a user-defined color scheme determined by the ...
user240392's user avatar
0 votes
0 answers
157 views

How do I merge 8 data frame without having duplicate suffixes?

I'm trying to merge a grid cell data set with 7 travel time (to shopping centres) data sets. Here's the head of the grid cell data: Here's the head of one of the shopping centre data sets(The other ...
mfirdaus_96's user avatar
0 votes
1 answer
50 views

How to generate multi band raster map from CSV

I'm trying to generate a map from a CSV with percent land usages. The CSV data looks something like the following: Index x y l1 l2 l3 l4 l5 l6 l7 l8 l9 l10 l11 l12 l13 l14 l15 l16 l17 ...
Ark Lomas's user avatar
  • 127
0 votes
1 answer
82 views

Joining by attribute using Fuzzywuzzy module (Python Script)

I'm hoping to get some assistance of debugging my script using fuzzywuzzy attribute joins. I have housing permit data that needs to be joined to parcel data. Unfortunately, the housing permit data is ...
Warren Navarro's user avatar
0 votes
1 answer
82 views

Get geometry from a <geoprocessing describe geometry object object at 0x000001A9F576D120>

I am trying to use arcpy and pandas to build a line geometry from 2 point geometry columns in a pandas dataframe. I create the dataframe by loading in the featureclass using the GeoAccessor from ...
MrKingsley's user avatar
  • 1,443
0 votes
1 answer
69 views

df.spatial.to_featureclass produces an empty shapefile [closed]

I am using ArcGIS Pro 2.9.8 and Python 3.7 from the ArcGIS\PRO\bin\Python\envs\arcgis-pro-py3\python.exe. I have a pandas dataframe from CSV I am trying to get to a shapefile or featureclass for a set ...
MrKingsley's user avatar
  • 1,443
0 votes
0 answers
24 views

rasterio.mask.mask returning strange values

I am using rasterio.mask.mask to extract values from a raster based on a polygon feature: out_img, out_transform = mask(raster, feature, all_touched=True, crop=True, nodata=-999) Mostly it works ...
GlenS's user avatar
  • 566
1 vote
1 answer
86 views

Qgis Plugin DataPlotly (Ubuntu) : 'ModuleNotFoundError: No module named 'pandas'

I work with Qgis 3.34.0-Prizren on Ubuntu. I would like test and use the qgis DataPlotly plugin. I succeed in installing this plugin via the qgis plugin manager. But when i try to enable it still into ...
user35117's user avatar
  • 929
1 vote
1 answer
163 views

Merging a DataFrame with a GeoDataFrame based on two keys

I have a GeoDataFrame called gdf_points with a list of POINTs: index NAME geometry 1 A POINT(A) 2 B POINT(B) And another DataFrame called df_names in which each POINT is associated with possibly ...
Omer Tzuk's user avatar
1 vote
1 answer
123 views

Create multiband raster in Python from X, Y

How do you create a multiband raster in Python and save it as a .tif file from a long dataframe format? import pandas as pd import numpy as np from rasterio.crs import CRS import rasterio from ...
Andrei Niță's user avatar
0 votes
1 answer
337 views

Grouping Polygons by Attributes and by Distance Using GeoPandas and networkx

I am working on creating a unique group ID for a parcel dataset I have containing 115k records. I have been attempting to do this with PostGIS (Grouping Parcels with an ID based on conditions, Query ...
MapThug's user avatar
  • 27
1 vote
0 answers
358 views

ArcPy Pandas export spatial data frame to feature class

I am successfully creating two data frames with ArcPy and Pandas, 1) from an enterprise geodatabase feature class and 2) from an enterprise geodatabase table, then merging them into 3) data frame that ...
oldgrowth_forests_are_key's user avatar
0 votes
0 answers
47 views

Spatial join of multiple GDFs and extract values

I have several different polygon geodataframes: I would like to get the interseting area of one to another. I was able to do it like that: frames = [oranzove, modre, cervene, tyrkysove] empty = [] ...
adamekcerv's user avatar
1 vote
2 answers
568 views

Create pandas DataFrame from raster image - one row per pixel with bands as columns, preserving coordinates [duplicate]

I have a 37 band image that I hoping to transform so that each row is a pixel and each column a band. I am following what was suggested in this post: Create pandas DataFrame from raster image - one ...
Greta Martin's user avatar
2 votes
1 answer
604 views

Converting list of datapoints with variable CRS to WGS 84 using Python and GeoPandas

I have a file, metadata.csv, containing a list of N sensors, and their location: sensor_id, pos_east, pos_north, crs sensor1, 109435.44, 1157776.64, 5110 sensor2, 254194, 6593776, 25833 ...
Heigre's user avatar
  • 33
1 vote
0 answers
821 views

How to make folium multiple markers's popups display simultaneously on click on any one of them?

this code works fine but it only displays the popup of the clicked marker. I rather want that all markers' popups display when clicking on any marker of them. import folium import pandas as pd data = ...
Mahfoud B.'s user avatar
1 vote
2 answers
1k views

Building a GeoDataFrame out of a shapely GeometryCollection with shapely 2.0.0 -> ValueError: DataFrame constructor not properly called!

I successfully used to build a GeoDataFrame out of a shapely GeometryCollection (hereafter gc) as gdf = gpd.GeoDataFrame(gc) but I'm now facing this error with shapely 2.0.0: gdf = gpd.GeoDataFrame(gc)...
swiss_knight's user avatar
  • 10.5k
5 votes
1 answer
851 views

Converting Pandas column with featurecollection to GeoJSON

I downloaded a CSV that contains a column which has a GeoJSON format and imported it as Pandas DataFrame. How can I convert this to a GeoJSON .geojson? I have about 10,000 rows, each with information ...
CrossLord's user avatar
  • 215
6 votes
3 answers
5k views

Read a GDB table into a pandas dataframe in ArcPy

I have a set of tables that I have exported to a file geodatabase. I would like to read it into python as a pandas dataframe. When I try to read the file directly using pd.read_csv import pandas as pd ...
nrp1000's user avatar
  • 447
0 votes
1 answer
116 views

How to change eps float value to geographic meter distance

I have a problem in making distance meter parameters for the DBSCAN tool. The problem is that I don't know the eps unit to use and how to change it to meters to be a parameter. Here's the Python ...
dimas putra's user avatar
1 vote
1 answer
846 views

Why are some of my markers not showing up in Folium?

I'm creating a map in Folium and it is working great, except several hundred markers aren't showing up on the map. There is no error message, I just notice that there are fewer markers than I expect. ...
Henry 's user avatar
  • 11
1 vote
2 answers
817 views

GeoPandas .explode() FutureWarning: Currently, index_parts defaults to True, but in the future, it will default to False to be consistent with Pandas

I have a simple GeoDataFrame containing 2 records, with MultiPolygonZ having several single parts as geometry elements. When I try to split those in their single parts using the .explode() method, it ...
swiss_knight's user avatar
  • 10.5k
1 vote
1 answer
654 views

(Geo)DataFrame left join leads to NaN in all right values

Let these two CSV files on the disk: $ cat /path/to/gdf0.csv myid,geometry 332,"MULTIPOLYGON Z (((0 0 0, 0 0 1, 0 1 1, 0 0 0)))" 220,"MULTIPOLYGON Z (((1 1 1, 1 1 2, 1 2 2, 1 1 1)))&...
swiss_knight's user avatar
  • 10.5k
2 votes
3 answers
2k views

Creating GeoTIFF from Pandas DataFrame

I have a Pandas DataFrame that looks like this: SIF_743,latitude,longitude 0.7626782059669495,-85.90831756591797,22.40107536315918 0.3139636516571045,-85.9532470703125,22.630943298339844 0....
Rezwan's user avatar
  • 199
1 vote
1 answer
827 views

Merging points to linestrings using GeoPandas

I have two GeoPandas DataFrames: points (long,lat) : 60,000 rows Jams segment (LineStrings) : 204,000 rows I am trying to create a new DataFrame with the points that are located on LineStrings. I ...
Nati Elkayam's user avatar
1 vote
1 answer
263 views

Make XY Event Layer in arcpy using a pandas dataframe

I have a Pandas df with Latitude and Longitude columns I am trying to export to a featureclass using ArcPy. I cannot resolve the fiona and GeoPandas issue so I tried to use MakeXYEventLayer_management ...
MrKingsley's user avatar
  • 1,443
-2 votes
1 answer
2k views

Getting the intersection of two raster files using Pandas Python

I am trying to get the intersection (the overlap part) of two rasters but the thing is that by comparing them in a dataframe, I cannot find common points. I check on QGIS and there are common areas. ...
TheGame's user avatar
  • 47
1 vote
1 answer
101 views

How to aggregate data according to week and get centroid of all points from that week?

I have a dataframe that looks like this: I want to extract data by aggregating the dates by week, and taking a sum of the observation counts like this: pd.DataFrame(data.groupby([pd.Grouper(key='...
user216048's user avatar
0 votes
1 answer
223 views

Folium: ValueError: key_on `'FIPS'` not found

I'm working on a Folium choropleth map, using a shapefile from the Census bureau and religion data from the US Religion Census. I can get both sets of data loaded and cleaned up, so I have two DFs: ...
Adam's user avatar
  • 33
1 vote
0 answers
274 views

Recreating QGIS SAGA polygon self-intersection in python? [closed]

so I am trying to find a way to re-create the SAGA polygon self-intersection tool used in QGIS in python, but I am having some trouble figuring out how to organize the workflow. with the SAGA polygon ...
Ki-code's user avatar
  • 73
0 votes
1 answer
65 views

Creating an arcTool from Python Script - error with the output

I want to add this script to an ArcToolbox for a coworker, so that they can reorder a table's columns after exporting a table to excel. They are not savvy with code, so I'm trying to just provide them ...
Jordan's user avatar
  • 1
2 votes
1 answer
18k views

ValueError: Columns must be same length as key

I want to geocode a number of universities in Europe (stored in a csv file). The csv file contains only one column (Name). However, I am yet to complete the work, since my code contains bugs. When I ...
Edudzi's user avatar
  • 99
0 votes
1 answer
59 views

How can I fill a feature layer with data from an xlsx\xls spread sheet if the field names are different (mapping)

I'm developing a widget that suppose to take data from a specific spread sheet of an excel file (xlsx or xls) and fill a layer that I created using arcmap pro.. The layer has slightly different field ...
michael_s_1990's user avatar
2 votes
5 answers
3k views

Converting Pandas DataFrame to point feature dataset via ArcGIS function (e.g. XY Table To Point) in ArcPy

I have a specified output path output_path, and a Pandas DataFrame df with two rows containing geoinformation (i.e. x and y coordinates): #import relevant module import pandas as pd #define output ...
Foeke Boersma's user avatar
0 votes
1 answer
2k views

Getting area (%) of two intersecting polygons in Python

I am trying to calculate the area of two intersecting polygons in my GDB using Python (probably geopandas). I have found solution using PostGIS: SELECT layer.text, layer_2.text, sum(...
adamekcerv's user avatar
0 votes
1 answer
123 views

GeoPandas in ArcGIS Pro not updating operation performed

I am new in the programming area. I have done some code making use of sources on the web. That is why I am having trouble. In my query I have used GeoPandas, Pandas and numpy library to make ...
Daniel León's user avatar
0 votes
0 answers
61 views

Updating ArcGIS feature class from Python script not cooperating to code

I’m trying to update the Project_Name field in my feature class table with the following code: import arcpy import csv import pandas as pd with open(r'thepath.csv') as infile: ...
user avatar
0 votes
0 answers
114 views

Geometry calculation using Pandas UDF

I am creating Pandas UDF to calculate the Geometry length .The following is the code which I created to calculate Geometry length. from pyspark.sql.functions import pandas_udf import pandas as pd from ...
code_bug's user avatar
  • 101
1 vote
1 answer
2k views

Merge several JSON files into one CSV file

I have about 37 nested JSON files. The keys and the values are same in all the files. My objective is to combine the data in all the files into a single CSV file so I can analyze the output . I have ...
Edudzi's user avatar
  • 99
1 vote
1 answer
342 views

Create a shapefile of concentric circles in Python by buffering a point at different levels

The following code returns only the last circle's geometry. I need a shapefile containing geometry of all buffer operations. import pandas as pd import geopandas as gpd pd.options.mode....
kky's user avatar
  • 19
0 votes
0 answers
362 views

Google Earth Engine: loop raster extraction over image collection and create dataframes (geemap)

I would like to extract a large number of points (approximately 3000) from each image within an image collection, and return a pandas dataframe for each image. The function I'm using to extract raster ...
Feesh's user avatar
  • 43
1 vote
1 answer
1k views

Merge two GeoJSON into one in a dataframe

I have a dataframe containing GeoJSON: geojson checkpoint lom_name {"type":"LineString","coordinates":[[1,4],[2,5]]} 6 ...
Puzzlemaster's user avatar
2 votes
1 answer
714 views

Using Select by Attributes for large list of values in ArcPy

I have a CSV of integers containing meter numbers varying from 9 digits to 11 digits. I've written a simple script to read CSV to a list. import pandas as pd path = "example_path.csv" df = ...
cb101's user avatar
  • 23
1 vote
0 answers
233 views

Issue calling a subprocess from ArcGIS Pro Toolbox

I am developing a toolbox that - at some point - has to process a large amount of data and apply a function to each row. For efficiency reasons I already use a pandas dataframe. I am familiar with ...
jonas.neubuerger's user avatar
0 votes
1 answer
377 views

Create a geopackage file with integer attribute containing NULL values in GeoPandas

I've been asked to produce a geopackage file in a specified format where one attribute is specified to be int64 nullable, and my case includes NULL values. Trying in GeoPandas, my problem is that I ...
jarveliu's user avatar

1
2 3 4 5 6