类型错误:';浮动';对象在Python中不可编辑。。。昨天他在工作

类型错误:';浮动';对象在Python中不可编辑。。。昨天他在工作,python,typeerror,Python,Typeerror,完整的笔记本在这里我无法打开笔记本。你能发布一个小样本数据集吗?该错误意味着hashtag\u list是一个浮动对象,因此不可编辑。我们建议您在问题中包含所有必需的代码/数据,因为这将防止死链,并使您的问题/答案更易于搜索。您还记得昨天以来发生的更改吗?这个错误表明hashtag_list实际上不是一个列表,而是一个float。只有列表或集合是可编辑的。 # Remove non-hashtags from hashtag list. hashtag_metadata['hashta

完整的笔记本在这里

我无法打开笔记本。你能发布一个小样本数据集吗?该错误意味着
hashtag\u list
是一个浮动对象,因此不可编辑。我们建议您在问题中包含所有必需的代码/数据,因为这将防止死链,并使您的问题/答案更易于搜索。您还记得昨天以来发生的更改吗?这个错误表明hashtag_list实际上不是一个列表,而是一个float。只有列表或集合是可编辑的。
    # Remove non-hashtags from hashtag list. 
hashtag_metadata['hashtags'] = hashtag_metadata['hashtags'].apply(
    lambda hashtag_list: [h for h in hashtag_list if h.startswith('#')])

    # Create a flattened list of all hashtags
all_hashtags = [hashtag for hashtags in hashtag_metadata['hashtags'] for hashtag in hashtags]

    # Coerce to a set to remove duplicate entries
# Sort to ensure reproducibility of results
all_hashtags = sorted(list(set(all_hashtags)))

    # Build lookup for finding hashtag number based on hashtag name
hashtag_lookup = {hashtag: i for i, hashtag in enumerate(all_hashtags)}
----> 3     lambda hashtag_list: [h for h in hashtag_list if h.startswith('#')])
      4 
      5 # Create a flattened list of all hashtags

TypeError: 'float' object is not iterable