mdeff / fma

FMA: A Dataset For Music Analysis
https://arxiv.org/abs/1612.01840
MIT License
2.21k stars 432 forks source link

KeyError when load tracks in baseline ipynb #16

Closed egg-west closed 6 years ago

egg-west commented 6 years ago

tracks = utils.load(r'data\fma_metadata\tracks.csv')
features = utils.load(r'data\fma_metadata\features.csv')
echonest = utils.load(r'data\fma_metadata\echonest.csv')

np.testing.assert_array_equal(features.index, tracks.index)
assert echonest.index.isin(tracks.index).all()

tracks.shape, features.shape, echonest.shape

This is the second block in the baseline.ipynb, I get this KeyError:


<ipython-input-9-ed98c1f7f0d0> in <module>()
      1 AUDIO_DIR = os.environ.get('AUDIO_DIR')
      2 
----> 3 tracks = utils.load(r'data\fma_metadata\tracks.csv')
      4 features = utils.load(r'data\fma_metadata\features.csv')
      5 echonest = utils.load(r'data\fma_metadata\echonest.csv')

G:\www\fma\utils.py in load(filepath)
    201                    ('track', 'genres_top')]
    202         for column in COLUMNS:
--> 203             tracks[column] = tracks[column].map(ast.literal_eval)
    204 
    205         COLUMNS = [('track', 'date_created'), ('track', 'date_recorded'),

C:\ProgramData\Anaconda3\lib\site-packages\pandas\core\frame.py in __getitem__(self, key)
   1960             return self._getitem_frame(key)
   1961         elif is_mi_columns:
-> 1962             return self._getitem_multilevel(key)
   1963         else:
   1964             return self._getitem_column(key)

C:\ProgramData\Anaconda3\lib\site-packages\pandas\core\frame.py in _getitem_multilevel(self, key)
   2004 
   2005     def _getitem_multilevel(self, key):
-> 2006         loc = self.columns.get_loc(key)
   2007         if isinstance(loc, (slice, Series, np.ndarray, Index)):
   2008             new_columns = self.columns[loc]

C:\ProgramData\Anaconda3\lib\site-packages\pandas\core\indexes\multi.py in get_loc(self, key, method)
   1998             key = _values_from_object(key)
   1999             key = tuple(map(_maybe_str_to_time_stamp, key, self.levels))
-> 2000             return self._engine.get_loc(key)
   2001 
   2002         # -- partial selection or non-unique index

pandas\_libs\index.pyx in pandas._libs.index.MultiIndexObjectEngine.get_loc (pandas\_libs\index.c:12722)()

pandas\_libs\index.pyx in pandas._libs.index.MultiIndexObjectEngine.get_loc (pandas\_libs\index.c:12643)()

pandas\_libs\index.pyx in pandas._libs.index.IndexEngine.get_loc (pandas\_libs\index.c:5280)()

pandas\_libs\index.pyx in pandas._libs.index.IndexEngine.get_loc (pandas\_libs\index.c:5126)()

pandas\_libs\hashtable_class_helper.pxi in pandas._libs.hashtable.PyObjectHashTable.get_item (pandas\_libs\hashtable.c:20523)()

pandas\_libs\hashtable_class_helper.pxi in pandas._libs.hashtable.PyObjectHashTable.get_item (pandas\_libs\hashtable.c:20477)()

KeyError: ('track', 'genres_top')```
addt commented 6 years ago

9, #10?

egg-west commented 6 years ago

image not so sure about what this means.

finally, I download the rc1 release on the data history page.

mdeff commented 6 years ago

The message is correct. It tells you that your working directory is now at commit 218fdb4, which is the commit the rc1 tag refers to.