Numpy slicing

128 views
Skip to first unread message

snan...@shilpasys.com

unread,
Dec 13, 2017, 2:35:29 AM12/13/17
to deap-users
Traceback (most recent call last):
  File "E:\SagarPython\machine_learining.py", line 88, in <module>
    ngen = num_generations, verbose = False)
  File "C:\Users\snang\AppData\Local\Programs\Python\Python35\lib\site-packages\deap\algorithms.py", line 151, in eaSimple
    for ind, fit in zip(invalid_ind, fitnesses):
  File "E:\SagarPython\machine_learining.py", line 50, in train_evaluate
    X,Y = prepare_dataset(train_data,window_size)
  File "E:\SagarPython\machine_learining.py", line 31, in prepare_dataset
    X = np.vstack([X,data[i:(i + window_size),0]])
  File "C:\Users\snang\AppData\Local\Programs\Python\Python35\lib\site-packages\pandas-0.21.0-py3.5-win-amd64.egg\pandas\core\frame.py", line 2139, in __getitem__
    return self._getitem_column(key)
  File "C:\Users\snang\AppData\Local\Programs\Python\Python35\lib\site-packages\pandas-0.21.0-py3.5-win-amd64.egg\pandas\core\frame.py", line 2146, in _getitem_column
    return self._get_item_cache(key)
  File "C:\Users\snang\AppData\Local\Programs\Python\Python35\lib\site-packages\pandas-0.21.0-py3.5-win-amd64.egg\pandas\core\generic.py", line 1840, in _get_item_cache
    res = cache.get(item)
TypeError: unhashable type: 'slice'
Reply all
Reply to author
Forward
0 new messages