cryptocurrency-price-prediction
cryptocurrency-price-prediction copied to clipboard
prepare_data throws errors
When callling the prepare_data function, I get a ton of errors, due to line two X_train = extract_window_data(train_data, window_len, zero_base) i.e. I can't even replicate the results (no matter if the logic is erroneous or not judging by comments on the blog and the issue list).
TypeError Traceback (most recent call last) C:\Python\Miniconda3\envs\mlenv\lib\site-packages\pandas\core\ops_init_.py in na_op(x, y) 967 try: --> 968 result = expressions.evaluate(op, str_rep, x, y, **eval_kwargs) 969 except TypeError:
C:\Python\Miniconda3\envs\mlenv\lib\site-packages\pandas\core\computation\expressions.py in evaluate(op, op_str, a, b, use_numexpr, **eval_kwargs) 220 if use_numexpr: --> 221 return _evaluate(op, op_str, a, b, **eval_kwargs) 222 return _evaluate_standard(op, op_str, a, b)
C:\Python\Miniconda3\envs\mlenv\lib\site-packages\pandas\core\computation\expressions.py in _evaluate_standard(op, op_str, a, b, **eval_kwargs) 69 with np.errstate(all="ignore"): ---> 70 return op(a, b) 71
TypeError: unsupported operand type(s) for /: 'str' and 'str'
During handling of the above exception, another exception occurred:
TypeError Traceback (most recent call last)
C:\Python\Miniconda3\envs\mlenv\lib\site-packages\pandas\core\ops_init_.py in f(self, other, axis, level, fill_value) 1497 pass_op = op if axis in [0, "columns", None] else na_op 1498 return _combine_series_frame( -> 1499 self, other, pass_op, fill_value=fill_value, axis=axis, level=level 1500 ) 1501 else:
C:\Python\Miniconda3\envs\mlenv\lib\site-packages\pandas\core\ops_init_.py in _combine_series_frame(self, other, func, fill_value, axis, level) 1398 1399 # default axis is columns -> 1400 return self._combine_match_columns(other, func, level=level) 1401 1402
C:\Python\Miniconda3\envs\mlenv\lib\site-packages\pandas\core\frame.py in _combine_match_columns(self, other, func, level) 5397 left, right = self.align(other, join="outer", axis=1, level=level, copy=False) 5398 assert left.columns.equals(right.index) -> 5399 return ops.dispatch_to_series(left, right, func, axis="columns") 5400 5401 def _combine_const(self, other, func):
C:\Python\Miniconda3\envs\mlenv\lib\site-packages\pandas\core\ops_init_.py in dispatch_to_series(left, right, func, str_rep, axis) 594 raise NotImplementedError(right) 595 --> 596 new_data = expressions.evaluate(column_op, str_rep, left, right) 597 598 result = left._constructor(new_data, index=left.index, copy=False)
C:\Python\Miniconda3\envs\mlenv\lib\site-packages\pandas\core\computation\expressions.py in evaluate(op, op_str, a, b, use_numexpr, **eval_kwargs) 219 use_numexpr = use_numexpr and _bool_arith_check(op_str, a, b) 220 if use_numexpr: --> 221 return _evaluate(op, op_str, a, b, **eval_kwargs) 222 return _evaluate_standard(op, op_str, a, b) 223
C:\Python\Miniconda3\envs\mlenv\lib\site-packages\pandas\core\computation\expressions.py in _evaluate_standard(op, op_str, a, b, **eval_kwargs) 68 _store_test_result(False) 69 with np.errstate(all="ignore"): ---> 70 return op(a, b) 71 72
C:\Python\Miniconda3\envs\mlenv\lib\site-packages\pandas\core\ops_init_.py in column_op(a, b) 582 583 def column_op(a, b): --> 584 return {i: func(a.iloc[:, i], b.iloc[i]) for i in range(len(a.columns))} 585 586 elif isinstance(right, ABCSeries):
C:\Python\Miniconda3\envs\mlenv\lib\site-packages\pandas\core\ops_init_.py in
C:\Python\Miniconda3\envs\mlenv\lib\site-packages\pandas\core\ops_init_.py in wrapper(left, right) 1046 1047 with np.errstate(all="ignore"): -> 1048 result = na_op(lvalues, rvalues) 1049 return construct_result( 1050 left, result, index=left.index, name=res_name, dtype=None
C:\Python\Miniconda3\envs\mlenv\lib\site-packages\pandas\core\ops_init_.py in na_op(x, y) 968 result = expressions.evaluate(op, str_rep, x, y, **eval_kwargs) 969 except TypeError: --> 970 result = masked_arith_op(x, y, op) 971 972 return missing.dispatch_fill_zeros(op, x, y, result)
C:\Python\Miniconda3\envs\mlenv\lib\site-packages\pandas\core\ops_init_.py in masked_arith_op(x, y, op) 462 if mask.any(): 463 with np.errstate(all="ignore"): --> 464 result[mask] = op(xrav[mask], y) 465 466 result, changed = maybe_upcast_putmask(result, ~mask, np.nan)
TypeError: unsupported operand type(s) for /: 'str' and 'str'
Yes It's throwing error
I am experiencing the same problem... how can it be fixed?
I personally haven't bothered with this code anymore since the method isn't that good. And since the author doesn't seem to care, it's not worth the effort. Probably better to go through e.g. Pytorch stock market prediction tutorial and use it with crypto instead.
@DocMinus nice suggestion... Do you have some good tutorials, links to share?