Comments (3)
Following our guides here I can read in your table data:
https://developers.arcgis.com/python/guide/part2-data-io-reading-data/#read-in-non-spatial-table-data
from arcgis-python-api.
@nanaeaubry thanks for giving this a shot in your environment. I wonder if it's an issue with my version of Pro or Python. Can you share the code you used to test reading in my csv so that I can try it?
Also, I did find a work around for now by using XLS instead. Here's the code I'm using:
trendstable.to_excel(outputXLSFile)
trendstable = arcpy.ExcelToTable_conversion(outputXLSFile, outputTable, 'Sheet1')
trendstable = arcpy.management.Append(inputs=[outputTable], target=CrimeTrendsTableLyr.url)[0]
I'm not sure if the issue I'm having with the CSV is the delimiter, separator, header or something else in how CSVs are created and read back in. During my research I found some weird behavior with the CSV. For example, when I open it in Excel all the data would appear fine. Same for if I viewed it using the print command in Python. However, when trying to read it in using an arcpy command or open it as a table in ArcGIS Pro some columns have null data. Using XLS instead worked great so I'm glad to have a solution but would like to understand the cause better at some point and why I can't get this to work using a CSV.
from arcgis-python-api.
@georaleigh
Sure so I also have arcpy in my environment and here is the code I used:
from arcgis.gis import GIS
import pandas as pd
gis = GIS(profile = "your_online_profile")
tbl_df = pd.DataFrame.spatial.from_table(filename=r'C:\workspace\trendstable_test.csv')
tbl_df.head(2)
I have python 3.9 and using our latest api version
You can check the version of the python api by doing:
import arcgis
print(arcgis.__version__)
Maybe this is an issue in python api version 2.2.0.2? I will try to test with older versions and see what happens.
from arcgis-python-api.
Related Issues (20)
- Table query fails with "TypeError: Casting to unit-less dtype 'datetime64' is not supported. Pass e.g. 'datetime64[ns]' instead." HOT 6
- clone_items() with item_mapping parameter misses group layers in the web map HOT 1
- Item.share() is not working when the groups parameter is specified HOT 1
- generate_raster fails in local and ArcGIS Online notebooks HOT 3
- Installing into Azure Databricks. Could you document recommended arcgis & databricks runtime versions and prerequisites?
- AttributeError: module 'numpy' has no attribute 'float' HOT 1
- Property resouces of Server class is misspelled. HOT 1
- Identify a StoryMap's Theme HOT 7
- AttributeError: 'Server' object has no attribute 'services' HOT 1
- Empty SHAPE HOT 4
- Efficient way to identify ArcGIS Online Named User Pro licenses that have been taken offline HOT 1
- Why is the Folders class not named FolderManager? HOT 3
- workforce.Project.assignment.add() - TypeError: Object of type FeatureSet is not JSON serializable (Did not exist in previous version)
- Upload a photo returns 'Item type not valid.' HOT 2
- `sources` endpoint for hosted views is not exposed
- GeoAccessor.to_featureclass function converting all column names to lowercase when sanitize_columns parameter is True HOT 1
- Publish function for shapefile items create duplicate indexes for area and length HOT 10
- In clone_items, a valid name is not always created if the name of the original item is missing (None) HOT 1
- FeatureLayerCollectionManager insert_layer() fails with unknown error HOT 9
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from arcgis-python-api.