【问题标题】:How can I extract unique strings from a Dataframe column?如何从 Dataframe 列中提取唯一字符串?
【发布时间】:2018-07-26 13:58:46
【问题描述】:

我有一个数据框“df_copy”,其中有一列“流派”。在该列中,每个条目都有一个或多个流派。类似this

我希望提取列中存在的所有独特类型。

我该怎么做?

【问题讨论】:

    标签: python pandas numpy jupyter


    【解决方案1】:
    new_df = df_copy['genres'].str.split(',',expand = True)
    

    【讨论】:

      猜你喜欢
      • 2020-03-19
      • 1970-01-01
      • 1970-01-01
      • 2018-03-30
      • 1970-01-01
      • 1970-01-01
      • 2013-06-05
      • 2021-08-21
      • 1970-01-01
      相关资源
      最近更新 更多