如何在熊猫中将列值转换为字符串数组?

时间:2019-08-12 00:47:09

标签: python pandas

我在pandas中有一个数据框,其中包含以下数据:

>>> df.head(5)
  currency code currency name
0           1ST    FirstBlood
1         2GIVE      GiveCoin
2           808       808Coin
3           ABT      ArcBlock
4           ABY       ArtByte

我想知道如何将列currency code转换为像['1ST', '2GIVE', '808', 'ABT' ... ]这样的字符串数组。

1 个答案:

答案 0 :(得分:0)

您可以检查

df['currency code'].tolist()