Giter Site home page Giter Site logo

Comments (3)

nanaeaubry avatar nanaeaubry commented on June 12, 2024

@georaleigh

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.

georaleigh avatar georaleigh commented on June 12, 2024

@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.

nanaeaubry avatar nanaeaubry commented on June 12, 2024

@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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.