Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Statistics for cells within a given polygon/raster #68

Closed
MAfarrag opened this issue Dec 28, 2023 · 0 comments
Closed

Statistics for cells within a given polygon/raster #68

MAfarrag opened this issue Dec 28, 2023 · 0 comments

Comments

@MAfarrag
Copy link
Member

Add a mask parameter (raster/polygon) to be used to calculate the stats of the cells that lies within this given raster/polygon.

[pyramids] pyramids/dataset.py (Lines 540-561)


def stats(self, band: int = None) -> DataFrame:
        """stats.

            - Get statistics of a band.
                [min, max, mean, std]

        Parameters
        ----------
        band: [int]
            band index, if None the statistics of all bands will be returned.

        Returns
        -------
        DataFrame:
            DataFrame of statistics values of each band, the dataframe has the following columns:
            [min, max, mean, std], the index of the dataframe is the band names.
                           min         max        mean       std
            Band_1  270.369720  270.762299  270.551361  0.154270
            Band_2  269.611938  269.744751  269.673645  0.043788
            Band_3  273.641479  274.168823  273.953979  0.198447
            Band_4  273.991516  274.540344  274.310669  0.205754
        """

Open in IDE · Open on GitHub

Created from JetBrains using CodeStream

@MAfarrag MAfarrag changed the title statistics for cells within a given polygon/raster Statistics for cells within a given polygon/raster Dec 28, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant