Updating a table using API instructions in Python

Hi everybody,

I’ve got a table “DATA” with geographical data that i need to convert from (x,y) to (lon, lat).

I used a python script within the Jupyter Widget.

# Initialisation
%pip install pyproj
import pandas as pd
from pyproj import Transformer
# Collecting data froma table
df = pd.DataFrame(await grist.fetch_selected_table())
print(df)
# Configuration transformation Lambert 93 -> WGS84
transformer = Transformer.from_crs("EPSG:2154", "EPSG:4326", always_xy=True)
# Transformation and append
df[['lon', 'lat']] = df.apply(lambda row: pd.Series(transformer.transform(row['x'], row['y'])), axis=1)
print(df)
# Update Table

I’ve got no problem to extract and transform my data in a dataframe (pandas)

My problem now is to push this new data in my original table.

I think i have to do an “update(records, options)” (Interface: TableOperations - Grist Help Center)
but don’t undestand how…

Thanks !