Skip to content

Commit

Permalink
fix: 🐛 fix missing imports
Browse files Browse the repository at this point in the history
  • Loading branch information
Thomas Bury committed Sep 23, 2023
1 parent ea30112 commit a522ed0
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 14 deletions.
12 changes: 4 additions & 8 deletions src/geomapviz/aggregator.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import numpy as np
import pandas as pd
import warnings
import geopandas as gpd
from typing import Optional, Union, Tuple, List, Dict, Literal
from pandas.api.types import is_numeric_dtype
Expand Down Expand Up @@ -28,16 +29,11 @@ def encode_categorical_columns(df: pd.DataFrame) -> pd.DataFrame:
>>> import pandas as pd
>>> from typing import List
>>> df = pd.DataFrame({'A': pd.Categorical(['a', 'b', 'c', 'a'], categories=['a', 'b', 'c']),
'B': pd.Categorical(['b', 'a', 'b', 'c'], categories=['a', 'b', 'c']),
'C': [1, 2, 3, 4],
'D': [5, 6, 7, 8]})
>>> 'B': pd.Categorical(['b', 'a', 'b', 'c'], categories=['a', 'b', 'c']),
>>> 'C': [1, 2, 3, 4],
>>> 'D': [5, 6, 7, 8]})
>>> encoded_df = encode_categorical_columns(df)
>>> print(encoded_df)
A B C D
0 0 1 1 5
1 1 0 2 6
2 2 1 3 7
3 0 2 4 8
"""
cat_cols = df.select_dtypes("category").columns.tolist()
if cat_cols:
Expand Down
1 change: 0 additions & 1 deletion src/geomapviz/plot.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
"""
# Settings and libraries
from __future__ import print_function
from os.path import dirname, join
from mpl_toolkits.axes_grid1 import make_axes_locatable
from typing import Optional, Union, Tuple, List, Dict

Expand Down
4 changes: 1 addition & 3 deletions src/geomapviz/shapefiles.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,8 @@
# Settings and libraries
from __future__ import print_function
from os.path import dirname, join
from pkg_resources import resource_stream, resource_filename
from pkg_resources import resource_filename
from cartopy import crs
# pandas
import pandas as pd
import geopandas as gpd


Expand Down
3 changes: 1 addition & 2 deletions src/geomapviz/utils.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
# Settings and libraries
from __future__ import print_function
import numpy as np
import pandas as pd
from typing import Union, Optional, Tuple, List
from typing import List


def check_list_of_str(str_list: List[str], name: str = "str_list") -> None:
Expand Down

0 comments on commit a522ed0

Please sign in to comment.