This post was never resolved: https://community.esri.com/t5/arcgis-notebooks-questions/trouble-with-reading-local-csv-data-into-notebooks/td-p/1383788
I have the same question. I have a very simple script I'm attempting to use as a custom web tool in ExB. It works fine in Pro. In AGOL Notebooks I'm having trouble getting past the first function. It's probably because I'm not too familiar with Notebooks within AGOL.
'''
csv file > df > gdf > shp
'''
from arcgis.gis import GIS
gis = GIS("home")
import pandas as pd
import geopandas as gpd
# read csv file
f = r'C:\Users\me\Report_updated.csv'
file = pd.read_csv(f)
# convert to dataframe
df = pd.DataFrame(file)
# geocode
gdf = gpd.tools.geocode(df['ADDRESS'])
# extract lat long from geometry and put into dataframe
df['latitude'],df['longitude'],df['geometry'] = gdf.geometry.y, gdf.geometry.x, gdf.geometry
# generate GeometryArray of shapely Point geometries from x, y(, z) coordinates.
gdf = gpd.GeoDataFrame(df, geometry=gpd.points_from_xy(df.longitude, df.latitude), crs="EPSG:4326") #crs is optional
# write to shapefile
gdf.to_csv(r'C:\Users\me\report_geocode.csv')
I've put the file in local directories, network directories, used a relative path, reversed the slashes, etc... I usually end up with FileNotFoundError.