Я очень плохо знаком с наукой о данных и программированием.Я работаю над набором метаданных фильмов из kaggle, пытаюсь проверить имена столбцов и установить индекс.Но при открытии CSV в jupyter все имена столбцов отображаются с суффиксом 'u'.Как заголовок столбца отображается как -u'title.В видео, где воспроизводится пример, имена столбцов не отображаются с префиксом.При попытке установить тот же столбец, что и индекс, он генерирует KeyError.
Я пробовал с python2
df.columns
Index([u'adult', u'belongs_to_collection', u'budget', u'genres', u'homepage',
u'id', u'imdb_id', u'original_language', u'original_title', u'overview',
u'popularity', u'poster_path', u'production_companies',
u'production_countries', u'release_date', u'revenue', u'runtime',
u'spoken_languages', u'status', u'tagline', u'title', u'video',
u'vote_average', u'vote_count'],
dtype='object')
#Change the index to the title
df = df.set_index('title')
Error:
pandas\_libs\index.pyx in pandas._libs.index.IndexEngine.get_loc()
pandas\_libs\index.pyx in pandas._libs.index.IndexEngine.get_loc()
pandas\_libs\hashtable_class_helper.pxi in pandas._libs.hashtable.PyObjectHashTable.get_item()
pandas\_libs\hashtable_class_helper.pxi in pandas._libs.hashtable.PyObjectHashTable.get_item()
KeyError: 'title'