(df: nw.DataFrame, col_name: str)
| 159 | |
| 160 | |
| 161 | def _is_continuous(df: nw.DataFrame, col_name: str) -> bool: |
| 162 | if nw.dependencies.is_pandas_like_dataframe(df_native := df.to_native()): |
| 163 | # fastpath for pandas: Narwhals' Series.dtype has a bit of overhead, as it |
| 164 | # tries to distinguish between true "object" columns, and "string" columns |
| 165 | # disguised as "object". But here, we deal with neither. |
| 166 | return df_native[col_name].dtype.kind in "ifc" |
| 167 | return df.get_column(col_name).dtype.is_numeric() |
| 168 | |
| 169 | |
| 170 | def _to_unix_epoch_seconds(s: nw.Series) -> nw.Series: |
no outgoing calls
no test coverage detected