我想提取并返回 pandas 中对象的内容、值。
例如我有...
>>> xx[xx['Business']=="1"]['Label']
3 Sloan School of Management
22 Business
46 Business Administration
我只想要标签列表,没有索引,没有熊猫对象,没有数组。如何仅提取数据以返回表单列表...
["Sloan School of Management", "Business", "Business Administration"]
尝试xx[xx['Business']=="1"]['Label'].values
产生了一个数组:
array([Sloan School of Management, Business, Business Administration,
Professional Development, Business & Management], dtype=object)
对于我正在尝试做的事情,必须有一个内置且相当常见的命令,对吧?