Skip to content

Commit

Permalink
Merge pull request #206 from JohnSnowLabs/502
Browse files Browse the repository at this point in the history
pandas >=2 compatibility
  • Loading branch information
C-K-Loan committed Oct 8, 2023
2 parents 55d7d18 + fdbc5f8 commit 1f77f2b
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
6 changes: 5 additions & 1 deletion nlu/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
__version__ = '5.0.1'
__version__ = '5.0.2'


import nlu.utils.environment.env_utils as env_utils

Expand All @@ -18,6 +19,9 @@
from nlu.discovery import Discoverer
from nlu.pipe.component_resolution import *

# apply hotfix
import pandas as pd
pd.DataFrame.iteritems = pd.DataFrame.items

def version(): return __version__

Expand Down
2 changes: 1 addition & 1 deletion nlu/pipe/col_substitution/col_name_substitution_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ def substitute_col_names(df, anno_2_ex, pipe, stranger_cols=[], get_embeddings=F
for k in cols_to_rename:
# some cols might not exist because no annotations generated, so we need to double check it really exists
if k not in df.columns: del new_cols[k]
return df.rename(columns=new_cols)[set(new_cols.values()).union(set(stranger_cols))] if drop_debug_cols else \
return df.rename(columns=new_cols)[list(set(new_cols.values()).union(set(stranger_cols)))] if drop_debug_cols else \
df.rename(columns=new_cols)

@staticmethod
Expand Down

0 comments on commit 1f77f2b

Please sign in to comment.