Hi all. Sorry, I'm relatively new to all of this and wanted to ask what the easiest way to accomplish this would be. Below is an example of the code I am working with:
import pandas as pd
from arcgis.gis import GIS
gis = GIS(ServerURL, username, password, verify_cert=False)
df1 = pd.DataFrame([["foo", -90.0, 30.0], ["bar", -91.0, 31.0]], columns = ["ID", "Longitude", "Latitude"])
df1SEDF = df1.spatial.from_xy(df1, "Longitude", "Latitude")
dataFrameLayer = df1SEDF.spatial.to_featurelayer("DataFrame to a layer", gis)
# df1SEDF is published to the server
df2 = pd.DataFrame([["foo", -90.0, 30.0], ["fighter", -93.0, 33.0]], columns = ["ID", "Longitude", "Latitude"])
df2SEDF = df1.spatial.from_xy(df2, "Longitude", "Latitude")The first six lines of code runs fine, takes the two points in the dataframe and adds them to the server (as a Shapefile and Feature Layer (hosted)).
What would be the easiest way to update the layer with the contents of the second dataframe? The ID column is unique if that matters. It could be an overwrite, or update only the changes (remove "bar" and add "fighter").
Any help is much appreciated. Thanks!