Stack Exchange Network

Stack Exchange network consists of 174 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

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.

1
vote
1answer
19 views

Extracting values from array created with FeatureClassToNumPyArray and converted to DataFrame?

I cannot understand how to use the values in the arrays created with arcpy.FeaturesToNumPyArray. I want to create an array and then convert them to a pandas DataFrame. So I created an array from ...
0
votes
1answer
59 views

How to create a GeoDataFrame points grid from a numpy.mgrid?

I'm trying to create a GeoDataFrame points grid from a numpy.mgrid. I already have created the numpy.mgrid with coordinates of future points. >>>arr = np.mgrid[-1827342.1753285176:-1827523....
2
votes
1answer
52 views

Calculate mean values for all bands and date to a dataframe

I have 5 rasters, each having 10 bands, where each band corresponds to a specific date. How do I calculate mean values for all 10 bands and save them? I need to save the mean values in a dataframe ...
1
vote
0answers
28 views

Preserving data types when publishing to ArcGIS Online using ArcGIS Python API?

I have a Python script which does some data manipulation using Pandas dataframes, then outputs to CSV. The CSVs are then published to AGOL using the ArcGIS Python API, overwriting the existing ...
3
votes
1answer
113 views

GeoPandas spatial join and count

I have following two GeoDataFrames. One with the crime count per polygon per year. Polygon Year total_crime shape_area geometry 0 0 2009 1 3.266388e+06 ...
0
votes
0answers
71 views

Creating geodatabase table from pandas data frame?

I have a .xlsm file which I use to update an existing point feature class, with the information from a certain sheet. The data from the sheet has to be projected in GIS using Route events, and later, ...
0
votes
1answer
41 views

Compare same values and keep biggest number's value in another column? [closed]

Here is an example to explain what I mean: I want from this: index area key 0 1 50 1f 1 2 60 2 2 3 70 3d 3 5 80 4 4 1 90 5 5 2 100 6 6 ...
1
vote
1answer
57 views

Creating LineString and length of LineString from multiple latlon points for each row in a Pandas Dataframe

So I want to create a LineString and get the length of the LineString from two sets of LatLon coordinates (points) in each row in a Pandas Dataframe, and store in a new column How can I do this?
1
vote
0answers
64 views

How to identify unique attributes in a column and add them as separate columns and perform spatial join sum in python

I need to extract all unique values from the "CATEGORIES" column from shapefile 2 (from the Shapefile and its data frame is shown below) and add them as columns to the Shapefile-A data table (see ...
3
votes
1answer
148 views

How to create the prj file with fiona and geopandas?

I am trying to create a shapefile and a geojson using geopandas and fiona. import fiona import fiona.crs ... geometry = [Point(xy) for xy in zip(df['longitude'],df['latitude'])] crs = {'init': '...
1
vote
1answer
45 views

Encoding in Python toolbox?

My Python toolbox uses a function (code below) to save values to a CSV file. When I was using the same code in a Jupyter notebook, saved records were properly encoded (I am dealing with Polish letters ...
1
vote
0answers
100 views

Reading data to geopandas using WFS - GML format

This relates to the question here: Reading data to geopandas using WFS? Is there a way to to do the same with a service that does not supply the data in GeoJSON format, but in GML-format? The ...
1
vote
0answers
34 views

Select different columns from each feature layer to be count values [closed]

How to count values (occurences of values) in each feature layer using a loop? The problem is that the column names are not the same for all layers. I have a table that has columns: ...
2
votes
0answers
57 views

QGIS plugin external libraries in plugin’s directory

I’m developing my first QGIS plugin and I have to use two external libraries not included in the default OSGeoW64 installation: Couchdb and Pandas. I would like to include those libraries in my ...
1
vote
1answer
45 views

Joining attributes after selecting one polygon which intersects another using geopandas?

To select the polygons which overlap other layer's polygons, I came up with this code based on what I found on this site: import geopandas as gpd import fiona import os import sys # Get the current ...
1
vote
1answer
1k views

Uninstalling and Reinstalling Anaconda

I had 2 versions of pandas (22 and 23) in my Anaconda environment for Python 3.6. One of the pandas looks like it was installed through Python 2.7 pip. Basically, I am unable to import pandas at all ...
2
votes
1answer
57 views

How to process 2 GeoDataFrames by rows pairwise?

I have 2 GeoDataFrames 100 records each, and want to calculate distances between respective geometries (Points, of course). I can't see how to make it other than write a cycle to iterate rows ...
0
votes
0answers
98 views

Error 001156: Failed on input OID -1, could not write value to output field (ArcPy)

I have written a script that takes an excel file, reads it into Pandas and creates two data frames based on the value inside a column ('Place'). From there I read the Pandas data frames back to CSV ...
0
votes
1answer
40 views

StopIteration: iteration not started Error when zipping a cursor using arcpy.da.UpdateCursor

I've run into a StopIteration: iteration not started error while trying to order a table using an update cursor. Is this caused by zipping the cursor together? I've tried updating a different table ...
1
vote
1answer
178 views

Join Pandas Dataframe to Shapefile?

I have a shapefile: Street1 Street2 Street3 Field Clark Taylor Field Jackson State Franklin 23rd 25th And a Dataframe df: Page Entry_Date 12 08012018 17 ...
2
votes
2answers
185 views

Replace several coordinates by its mean value grouped by multiindex Pandas

I have a table with some info that are getting by a GPS, in my table I have this structure: Date Time Latitude Longitude Accuracy Weather Visibility ViewPoint Species Bearing ...
2
votes
1answer
118 views

Extracting GPS points inside the region boundary

I have large set of GPS coordinates of human mobility in different parts of China, but I am only interested in points in Beijing City. These points are in excel csv file that I read into pandas ...
1
vote
0answers
198 views

Dividing Geographical region into equal sized grid and retrieving indexing position

I have GPS coordinates of human mobility in Beijing Area. I want to divide geographical space in to rectangular grid, for example 2 sq. km (delta), and access the indexing position of any point inside ...
2
votes
2answers
853 views

Visualizing GPS points on interactive map [closed]

I am using version 3.0 of python, I want to visualize GPS points in my dataset on interactive map. Is there any python library that can help me to visualize my data on maps. Reference of any tutorial ...
1
vote
2answers
391 views

Transfering from pandas dataframe to Geopandas?

I am not able to transfer a pandas dataframe column with geolocation coordinates into a Geopandas Point format. location = pd.read_csv('City_addresses') print location['Geolocation'].head() Outputs ...
4
votes
0answers
125 views

Taking ArcGIS feature class to pandas pivot table? [closed]

I'm new to pandas and am trying to create a pivot table based off of two fields - DIVISION and MATERIAL. I'd like to count each occurances of each value. Rows would be DIVISION and columns would be ...
2
votes
1answer
175 views

Importing pandas dataframe as layer in QGIS?

I'm working on a dataset that is readily available as a pandas dataframe object. Now, I would like to import this data as a layer in QGIS. I didn't find any helpful library or code to do so. So, I ...
0
votes
1answer
526 views

Saving dataframe as dbf with simpledbf in Python?

I am doing a number of joins outside of ArcGIS as pandas seems to outperform it. I read in the dbf file with simpledbf, convert it to a dataframe, then do the join: import pandas as pd from simpledbf ...
0
votes
1answer
297 views

How to display large geospatial data in a jupyter notebook with style and tooltip?

I have a large amount of data stored on a postgreSQL database (RDS) with the PostGIS extension enabled. We are currently doing quality assessment of the data and therefore I would like to inspect/...
0
votes
0answers
133 views

Adding Unique Properties to Each Feature in a Large GeoJson

I previously asked Add properties to large GeoJSON but that was rather unclear and I learned something from people's feedback. I went back to the drawing board and got even more confused. I am trying ...
1
vote
0answers
230 views

Group by index column, compare area and add values to new column in Python?

I have these columns: index, area_of_poly, cad_admin I have to group by index (it is a normal column called index) in order to take the rows that have the same value. #all the ones, all the twos, ...
0
votes
3answers
69 views

Populate missing fields/labels for a grid of polygons with python? [closed]

I have an Esri polygon feature class in a grid that covers a geographic region, and one field, which we'll call 'Label' has an arbitrary label that consists of two digits for north/south, and two ...
1
vote
0answers
91 views

Why GROUPBY doesn't work?

I don't know why but pandas groupby doesn't work in this case whereas I used it well in other scripts. All lines are still there after it. This is my code: all_points['WKT'] = all_points['geometry']...
3
votes
1answer
954 views

How to create a raster from csv points file [duplicate]

I have a CSV points file, with NDVI values. My goal is to create a GeoTiff with 10 meters pixel, where each pixel value is calculated as the mean of points values in this square. I read the CSV with ...
2
votes
1answer
2k views

How to measure distance between 2 GPS points in Pandas?

I have two data frames both containing x,y GPS coordinates and I'm trying to determine if they are within a 1/4, 1/2 and 1 mile of each other. Like this: # COORDS1 DAY LATITUDE ...
2
votes
1answer
369 views

Merging two datasets where polygons are nearly identical using geopandas?

I have two polygon-shapefiles representing similar data. However, the features in these layers are not always 100 % identical. So, a feature in shapefile 1 may be present in shapefile 2, but the form ...
-1
votes
1answer
253 views

Unable to import pandas in QGIS Windows [duplicate]

I am trying to import pandas 0.20.3 in QGIS console but it's giving me this error. Could any one help me to solve this problem. I used pip to install pandas in windows and QGIS version is 2.14
1
vote
1answer
3k views

Groupby Ploting - give each plot title/name

I have used this code to group by the continents and then plotted using geopandas. I would like to set the plot title for each continent. I would have liked also to draw the continents side by side. ...
0
votes
1answer
1k views

Using Folium HeatMapWithTime Plugin?

I am using pandas, and folium to replicate the following example, but with my CSV data to produce a heat map. Here's what my data looks like: and here is the code I am using currently: import ...
0
votes
1answer
65 views

Snap points to points of different layer (based on attributes, not nearest)

I have 2 layer of points, PointLayer1 and PointLayer2. PointLayer1 has to be snapped to PointLayer2. I have a table that has IDs of PointLayer1 that has to be snapped to PointLayer2. Sample Table: ...
3
votes
1answer
1k views

Iterate over ImageCollection returning pandas dataframe using earth engine & python

I'm trying to extract values from an ImageCollection to a series of points. My goal is to create a pandas dataframe that includes the values from each image & band of the ImageCollection for each ...
2
votes
1answer
613 views

Geopandas: US Cities (from JSON) and USA––Same CRS, Wrong Projection

To learn geopandas, I'm trying to layer US cities (raw json file) over a world map provided by Geopandas. With the same CRS, the US cities are showing up in the wrong place (picture below). If I used ...
1
vote
0answers
42 views

How to use shapefile to categorize set of coordinate by neighborhood?

Just a disclaimer, this is my first project with GIS so this may be really trivial. I have looked around but haven't found resources that were helpful to me. Currently I have a list of NYC ...
1
vote
0answers
207 views

select by attribute and calculate field: fiona, geopandas

This may be more of a python question than gis, but I have 3 bands in a polygon layer, and I would like to select earthquakes within each band and calculate a new field to note these locations (band 1,...
1
vote
0answers
662 views

HTML in folium popup, for loop

I want to put HTML formatting into a folium map popup. How do i format the html popup INSIDE my FOR loop??? My code: import folium import pandas from folium import IFrame data=pandas.read_csv("...
9
votes
1answer
2k views

Change marker size in plot with GeoPandas

I have a geodataframe with points and some associated data. I want to plot it on a map using geopandas and have the size of the points correspond to one of the columns in the geodataframe. So far I ...
4
votes
0answers
427 views

Import Pandas or any Python module into QGIS internal Python

(Also asked in stack overflow - https://stackoverflow.com/questions/43244062/import-pandas-or-any-python-module-into-qgis-internal-python ) I am developing a plugin for the current LTR version of ...
5
votes
2answers
2k views

Geopandas: Write layer back into GeoDataBase

I use geopandas (which uses fiona) to read a GeoDataBase layer (using driver="OpenFileGDB") into a geodataframe for easy manipulation. read_shp = gpd.read_file(GDB_file, layer=layer_choice) That ...
3
votes
1answer
547 views

Geopandas performance appears quite slow

I'd like to confirm the performance I am observing when utilizing distance from a Geopandas Series. Problem Time to complete operations appears to be far greater than comparable operation in ...
8
votes
3answers
5k views

Reading raw data into geopandas

Is it possible to read raw data into a geopandas GeoDataFrame, a la a pandas DataFrame? For example, the following works: import pandas as pd import requests data = requests.get("https://data....