---------------------------------------------------------------------------
ValueError Traceback (most recent call last)
<ipython-input-37-e16e49ec63df> in <module>
3
4 df = pd.read_csv('data/Coinbase_BTCUSD_1h.csv', skiprows=1)
----> 5 exchange = SimulatedExchange(data_frame=df, base_instrument='USD', should_pretransform_obs=True)
6
7 exchange.data_frame
C:\ProgramData\Anaconda3\lib\site-packages\tensortrade\exchanges\simulated\simulated_exchange.py in __init__(self, data_frame, **kwargs)
41
42 if data_frame is not None:
---> 43 self.data_frame = data_frame.astype(self._dtype)
44
45 self._commission_percent = kwargs.get('commission_percent', 0.3)
C:\ProgramData\Anaconda3\lib\site-packages\pandas\core\generic.py in astype(self, dtype, copy, errors, **kwargs)
5881 # else, only a single dtype is given
5882 new_data = self._data.astype(
-> 5883 dtype=dtype, copy=copy, errors=errors, **kwargs
5884 )
5885 return self._constructor(new_data).__finalize__(self)
C:\ProgramData\Anaconda3\lib\site-packages\pandas\core\internals\managers.py in astype(self, dtype, **kwargs)
579
580 def astype(self, dtype, **kwargs):
--> 581 return self.apply("astype", dtype=dtype, **kwargs)
582
583 def convert(self, **kwargs):
C:\ProgramData\Anaconda3\lib\site-packages\pandas\core\internals\managers.py in apply(self, f, axes, filter, do_integrity_check, consolidate, **kwargs)
436 kwargs[k] = obj.reindex(b_items, axis=axis, copy=align_copy)
437
--> 438 applied = getattr(b, f)(**kwargs)
439 result_blocks = _extend_blocks(applied, result_blocks)
440
C:\ProgramData\Anaconda3\lib\site-packages\pandas\core\internals\blocks.py in astype(self, dtype, copy, errors, values, **kwargs)
555
556 def astype(self, dtype, copy=False, errors="raise", values=None, **kwargs):
--> 557 return self._astype(dtype, copy=copy, errors=errors, values=values, **kwargs)
558
559 def _astype(self, dtype, copy=False, errors="raise", values=None, **kwargs):
C:\ProgramData\Anaconda3\lib\site-packages\pandas\core\internals\blocks.py in _astype(self, dtype, copy, errors, values, **kwargs)
639 # _astype_nansafe works fine with 1-d only
640 vals1d = values.ravel()
--> 641 values = astype_nansafe(vals1d, dtype, copy=True, **kwargs)
642
643 # TODO(extension)
C:\ProgramData\Anaconda3\lib\site-packages\pandas\core\dtypes\cast.py in astype_nansafe(arr, dtype, copy, skipna)
727 if copy or is_object_dtype(arr) or is_object_dtype(dtype):
728 # Explicit copy, or required since NumPy can't view from / to object.
--> 729 return arr.astype(dtype, copy=True)
730
731 return arr.view(dtype)
ValueError: could not convert string to float: '2019-10-16'
exchange = SimulatedExchange(data_frame=df, base_instrument='USD', should_pretransform_obs=True)
exchange.data_frame
---------------------------------------------------------------------------
ValueError Traceback (most recent call last)
<ipython-input-34-39bb0049e577> in <module>
1 df = pd.read_csv('data/Coinbase_BTCUSD_1h.csv', skiprows=1)
----> 2 exchange = SimulatedExchange(data_frame=df, base_instrument='USD', should_pretransform_obs=True)
3
4 exchange.data_frame
C:\ProgramData\Anaconda3\lib\site-packages\tensortrade\exchanges\simulated\simulated_exchange.py in __init__(self, data_frame, **kwargs)
41
42 if data_frame is not None:
---> 43 self.data_frame = data_frame.astype(self._dtype)
44
45 self._commission_percent = kwargs.get('commission_percent', 0.3)
C:\ProgramData\Anaconda3\lib\site-packages\pandas\core\generic.py in astype(self, dtype, copy, errors, **kwargs)
5881 # else, only a single dtype is given
5882 new_data = self._data.astype(
-> 5883 dtype=dtype, copy=copy, errors=errors, **kwargs
5884 )
5885 return self._constructor(new_data).__finalize__(self)
C:\ProgramData\Anaconda3\lib\site-packages\pandas\core\internals\managers.py in astype(self, dtype, **kwargs)
579
580 def astype(self, dtype, **kwargs):
--> 581 return self.apply("astype", dtype=dtype, **kwargs)
582
583 def convert(self, **kwargs):
C:\ProgramData\Anaconda3\lib\site-packages\pandas\core\internals\managers.py in apply(self, f, axes, filter, do_integrity_check, consolidate, **kwargs)
436 kwargs[k] = obj.reindex(b_items, axis=axis, copy=align_copy)
437
--> 438 applied = getattr(b, f)(**kwargs)
439 result_blocks = _extend_blocks(applied, result_blocks)
440
C:\ProgramData\Anaconda3\lib\site-packages\pandas\core\internals\blocks.py in astype(self, dtype, copy, errors, values, **kwargs)
555
556 def astype(self, dtype, copy=False, errors="raise", values=None, **kwargs):
--> 557 return self._astype(dtype, copy=copy, errors=errors, values=values, **kwargs)
558
559 def _astype(self, dtype, copy=False, errors="raise", values=None, **kwargs):
C:\ProgramData\Anaconda3\lib\site-packages\pandas\core\internals\blocks.py in _astype(self, dtype, copy, errors, values, **kwargs)
639 # _astype_nansafe works fine with 1-d only
640 vals1d = values.ravel()
--> 641 values = astype_nansafe(vals1d, dtype, copy=True, **kwargs)
642
643 # TODO(extension)
C:\ProgramData\Anaconda3\lib\site-packages\pandas\core\dtypes\cast.py in astype_nansafe(arr, dtype, copy, skipna)
727 if copy or is_object_dtype(arr) or is_object_dtype(dtype):
728 # Explicit copy, or required since NumPy can't view from / to object.
--> 729 return arr.astype(dtype, copy=True)
730
731 return arr.view(dtype)
ValueError: could not convert string to float: '2019-10-16'