sainsc.GridCounts.from_dataframe ================================ .. py:method:: sainsc.GridCounts.from_dataframe(df, *, resolution = None, binsize = None, n_threads = None) :classmethod: Initialize from dataframe. Transform a :py:class:`polars.DataFrame` that provides a 'gene', 'x', and 'y' column into :py:class:`sainsc.GridCounts`. If a 'count' column exists it will be used as counts else a count of 1 (single molecule) per row will be assumed. :param df: The data to be transformed. :type df: polars.DataFrame :param binsize: The size to bin the coordinates by. If None coordinates must be integers. :type binsize: float or None, optional :param resolution: Resolution of each coordinate unit in nm. The default is 1,000 i.e. measurements are in um. :type resolution: float, optional :param n_threads: Number of threads used for initializing :py:class:`sainsc.LazyKDE`. If `None` this will default to the number of logical CPUs. :type n_threads: int, optional :rtype: sainsc.GridCounts