如何在Python中从条件输出中分割第一列?
下面的代码打印了售出100000台的所有产品。我只想打印“title\u orig”列的值。我该怎么做 代码: 输出:如何在Python中从条件输出中分割第一列?,python,pandas,dataframe,Python,Pandas,Dataframe,下面的代码打印了售出100000台的所有产品。我只想打印“title\u orig”列的值。我该怎么做 代码: 输出: *title_orig* *units_sold* fashion women's strappy top 100000 women stretchy camisole 100000 women clothing long sleeve autum
*title_orig* *units_sold*
fashion women's strappy top 100000
women stretchy camisole 100000
women clothing long sleeve autumn 100000
summer red white and blue chiffon shirt 100000
我尝试将代码分配给一个变量并对其进行切片,但没有成功。使用
.loc
并传递所需的列
名称:
clothes.loc[clothes["units_sold"] == 100000, "title_orig"]
应该有用。试试这个,
衣服[衣服['units\u saled']==100000][“title\u orig”]
衣服。loc[衣服['units\u saled']==100000,“title\u orig']
这个有用!谢谢:)
clothes.loc[clothes["units_sold"] == 100000, "title_orig"]