asreview-datatools icon indicating copy to clipboard operation
asreview-datatools copied to clipboard

TypeError: unsupported operand type(s) for +: 'float' and 'str'

Open jteijema opened this issue 6 months ago • 4 comments

C:\Users\5927226\Downloads> asreview data compose output.xlsx -r '.\asreview_dataset_all_Search update 2023.xlsx' -u .\combined_update_dedup.xlsx
C:\Users\5927226\AppData\Local\Programs\Python\Python311\Lib\site-packages\asreview\io\utils.py:142: FutureWarning: A value is trying to be set on a copy of a DataFrame or Series through chained assignment using an inplace method.
The behavior will change in pandas 3.0. This inplace method will never work because the intermediate object on which we are setting values always behaves as a copy.

For example, when doing 'df[col].method(value, inplace=True)', try using 'df.method({col: value}, inplace=True)' or df[col] = df[col].method(value) instead, to perform the operation inplace on the original object.


  df[col].fillna(LABEL_NA, inplace=True)
Detected 260 records with label '1', from which 0 duplicate records with the same label were removed.
Detected 285 records with label '-1', from which 0 duplicate records with the same label were removed.
Traceback (most recent call last):
  File "<frozen runpy>", line 198, in _run_module_as_main
  File "<frozen runpy>", line 88, in _run_code
  File "C:\Users\5927226\AppData\Local\Programs\Python\Python311\Scripts\asreview.exe\__main__.py", line 7, in <module>
  File "C:\Users\5927226\AppData\Local\Programs\Python\Python311\Lib\site-packages\asreview\__main__.py", line 50, in main
    _execute_entry_point(entry, sys.argv[2:])
  File "C:\Users\5927226\AppData\Local\Programs\Python\Python311\Lib\site-packages\asreview\__main__.py", line 28, in _execute_entry_point
    entry().execute(args)
  File "C:\Users\5927226\AppData\Local\Programs\Python\Python311\Lib\site-packages\asreviewcontrib\datatools\entrypoint.py", line 95, in execute
    compose(
  File "C:\Users\5927226\AppData\Local\Programs\Python\Python311\Lib\site-packages\asreviewcontrib\datatools\compose.py", line 246, in compose
    df_composition = create_composition(
                     ^^^^^^^^^^^^^^^^^^^
  File "C:\Users\5927226\AppData\Local\Programs\Python\Python311\Lib\site-packages\asreviewcontrib\datatools\compose.py", line 157, in create_composition
    df_conflicting_dups = as_conflict.df[as_conflict.duplicated(pid)]
                                         ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\5927226\AppData\Local\Programs\Python\Python311\Lib\site-packages\asreview\data\base.py", line 538, in duplicated
    pd.Series(self.texts)
              ^^^^^^^^^^
  File "C:\Users\5927226\AppData\Local\Programs\Python\Python311\Lib\site-packages\asreview\data\base.py", line 282, in texts
    [self.title[i] + " " + self.abstract[i] for i in range(len(self))],
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\5927226\AppData\Local\Programs\Python\Python311\Lib\site-packages\asreview\data\base.py", line 282, in <listcomp>
    [self.title[i] + " " + self.abstract[i] for i in range(len(self))],
     ~~~~~~~~~~~~~~^~~~~
TypeError: unsupported operand type(s) for +: 'float' and 'str'

When testing on 2 different devices, @gui921 and I ran across is error when using the compose feature.

jteijema avatar Aug 06 '24 11:08 jteijema