sherpa-ai / sherpa

Hyperparameter optimization that enables researchers to experiment, visualize, and scale quickly.
http://parameter-sherpa.readthedocs.io/
GNU General Public License v3.0
333 stars 54 forks source link

Incompatability with Pandas > 1.5.0 #118

Open CCBeard opened 1 year ago

CCBeard commented 1 year ago

I believe the source code of SHERPA uses pandas.dataframe.append a couple of times. The pandas.dataframe.append method is deprecated in version 2.0 or higher, and this currently raises and attribute error. I found an easy workaround by amending two lines of code in core.py:

Original: self.results = self.results.append(pandas.DataFrame.from_dict(row), ignore_index=True) Modification: self.results = pandas.concat([self.results, pandas.DataFrame.from_dict(row)], ignore_index=True) And in one other spot:

Original: self.results = self.results.append(best_row, ignore_index=True) Modification: self.results = pandas.concat([self.results, best_row], ignore_index=True)