composeui.core.dataframesource¶
A dataframe’s rows in a large table, a chart or a map: pandas, Polars, PyArrow, lazy…
narwhals (the dataframe extra) reads each library’s frame through one API, so the
library sorts and filters the rows with its own expressions, never row by row in Python.
- class composeui.core.dataframesource.DataFrameSource[source]¶
Bases:
objectA
TableSourceof a dataframe’s rows, which a large table reads a window at a time.Build it with any frame
narwhalsreads (pandas, Polars, PyArrow, a PolarsLazyFrame…) and the headers by column:DataFrameSource(frame, {"lat": T("Latitude")}), every column under its name without them. A row’s id is its position in the frame, or itsid_columnwhen it has one: a lazy frame needs one, its rows having no position of their own. Assign a newframeto change the rows, which emitschanged.The frame’s library sorts and filters: a text compares in lower case, which isn’t Python’s
casefold(“ß” doesn’t find “SS”), and a/regex/is in the library’s syntax (Rust’sregexfor Polars,refor pandas). Equal cells, and the rows unsorted, keep the frame’s order.- property columns: Sequence[SourceColumn]¶
- property frame: IntoFrame¶
Get the frame given, in its own library.
- composeui.core.dataframesource.points_of(frame, latitude, longitude)[source]¶
Get a map’s points of a frame’s columns
latitudeandlongitude, in degrees.The rows missing either value, or out of a Web Mercator map (see
MapPoint), are left out.