geolime.utilities.dataframe¶
Classes:
|
A zero dimensional feature |
Functions:
|
Converts a DataFrame to a GeoDataFrame |
|
Converts a DataFrame to a GeoDataFrame |
-
geolime.utilities.dataframe.
df_to_gdf
(df: pandas.core.frame.DataFrame, x_col: str = 'x', y_col: str = 'y', crs: str = None)¶ Converts a DataFrame to a GeoDataFrame
- Parameters
df (pd.DataFrame) – original DataFrame to convert
x_col (pd.DataFrame) – column name containing the x coordinates
y_col (pd.DataFrame) – column name containing the y coordinates
crs (str) – coordinates system of the GeoDataFrame
- Returns
The converted GeoDataFrame
- Return type
pd.GeoDataFrame
-
geolime.utilities.dataframe.
gdf_to_df
(gdf: geopandas.geodataframe.GeoDataFrame, copy: bool = False)¶ Converts a DataFrame to a GeoDataFrame
- Parameters
gdf (pd.GeoDataFrame) – original DataFrame to convert
copy (bool) – copy the data of the GeoDataFrame before converting. useful to keep the GeoDataFrame and DataFrame independant.
- Returns
The converted DataFrame
- Return type
pd.DataFrame