0

I'm new to this machine learning, as the title says I have this error in the code and I can't solve it, I'm working on Python 3.7 in Pycharm.

TypeError: can only concatenate str (not "int") to str -

# where "Último" is a df with prices.

pred = []
for i in range(0,valid.shape[0]):
    a = train["Último"][len(train)-925+i:].sum() + sum(pred)
    b = a/925
    pred.append(b)
DjaouadNM
  • 22,013
  • 4
  • 33
  • 55
  • 1
    Please provide [mcve]. From what I can say, either of the operands to operator `'+'` is a string, so it's expecting other operand a string. – Austin Sep 15 '19 at 16:49
  • Such question is answered here: https://stackoverflow.com/questions/53465931/string-concatenate-typeerror-can-only-concatenate-str-not-int-to-str – greenmarker Jun 23 '20 at 04:28

0 Answers0