:py:mod:`geovizir` ================== .. py:module:: geovizir Subpackages ----------- .. toctree:: :titlesonly: :maxdepth: 3 resources/index.rst Submodules ---------- .. toctree:: :titlesonly: :maxdepth: 1 data/index.rst dplyr/index.rst features/index.rst scales/index.rst Package Contents ---------------- Functions ~~~~~~~~~ .. autoapisummary:: geovizir.glimpse geovizir.load_data geovizir.ne_countries geovizir.ne_states geovizir.label_bins geovizir.relabel_bins geovizir.get_data geovizir.get_data_most_recent Attributes ~~~~~~~~~~ .. autoapisummary:: geovizir.__version__ .. py:data:: __version__ .. py:function:: glimpse(df: pandas.DataFrame, max_width: int = 76) Print a pandas DataFrame by columns. Print the dimensions, column names, dtypes and first few values of a pandas DataFrame by columns. :param df: The pandas DataFrame to print. :type df: DataFrame :param max_width: The maximum width of the output, by default 76. :type max_width: int, optional .. py:function:: load_data(folder, filepath) .. py:function:: ne_countries(scale: int = 10) -> geopandas.GeoDataFrame Return a GeoDataFrame of the world countries. Download the world countries shapefile from Natural Earth and return a GeoDataFrame of the countries. :param scale: The scale of the shapefile, by default 10. The allowed values are 10, 50 and 110. :type scale: int, optional :returns: A table of the world countries. :rtype: GeoDataFrame .. py:function:: ne_states(state: str, scale: int = 10) -> geopandas.GeoDataFrame Return a GeoDataFrame of the stats of a country. Download the counties shapefile from Natural Earth and return a GeoDataFrame of the countries. :param state: The country ISO3 code. :type state: str :param scale: The scale of the shapefile, by default 10. The allowed values are 10, 50 and 110. :type scale: int, optional :returns: A table of the world countries. :rtype: GeoDataFrame .. py:function:: label_bins(bins: list[int, float]) -> list[str] Return a list of labels for a list of bins. For each element of the bins, an interval is created with the previous element. The first element is add as '< first_element' and the last element as '> last_element'. :param bins: A list of bins to be labeled. :type bins: list[float, int] :returns: A list of labels. :rtype: list[str] .. rubric:: Examples >>> bins([1,2,3]) .. py:function:: relabel_bins(column: pandas.Series) Relabel a column with the bins of the column. :param column: A column to be relabeled. :type column: Series :returns: A column with the labels of the bins. :rtype: Series .. py:function:: get_data(indicator: str, year: int) -> pandas.DataFrame Get data from the World Bank API :param indicator: Indicator code :type indicator: str :param year: Year :type year: int :returns: Dataframe with the data :rtype: pandas.DataFrame .. py:function:: get_data_most_recent(indicator: str) -> pandas.DataFrame Get the data from the World Bank API with the most recent year available :param indicator: Indicator code :type indicator: str :returns: Dataframe with the data :rtype: pandas.DataFrame