Skip to content

Commit

Permalink
Address the 'DataFrame' object has no attribute 'iteritems' error
Browse files Browse the repository at this point in the history
  • Loading branch information
brash6 committed Mar 25, 2024
1 parent 3eaea9a commit 280d11e
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
),
package_dir={"": "src"},
install_requires=[
'pandas==1.2.1',
'pandas>=1.2.1',
'scikit-learn>=0.22.1',
'numpy>=1.19.2',
'rpy2>=2.9.4',
Expand Down
5 changes: 5 additions & 0 deletions src/med_bench/utils/utils.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import numpy as np
import pandas as pd
import rpy2.robjects as robjects

import subprocess
Expand Down Expand Up @@ -55,6 +56,10 @@ def wrapper(*args, **kwargs):
)
return None

# To get rid of the 'DataFrame' object has no attribute 'iteritems' error due to pandas version mismatch in rpy2
# https://stackoverflow.com/a/76404841
pd.DataFrame.iteritems = pd.DataFrame.items

for package in required_packages:
if not check_r_package(package):
if package != 'plmed':
Expand Down

0 comments on commit 280d11e

Please sign in to comment.