作者Talent14 (Talent)
看板Python
标题[问题] dataframe指定index_col取值问题
时间Wed Aug 11 21:05:01 2021
因为怕手机打字会造成程式码与问题描述排版跑掉不方便阅读,所以附上问题叙述图片与程式码、资料图片,请大家帮忙或建议可能的方向,谢谢!
问题描述:
https://i.imgur.com/syO9xmY.jpg
程式码、dataframe资料:
https://i.imgur.com/ZqXPFOT.jpg
-----
Sent from JPTT on my iPhone
--
※ 发信站: 批踢踢实业坊(ptt.cc), 来自: 1.170.94.50 (台湾)
※ 文章网址: https://webptt.com/cn.aspx?n=bbs/Python/M.1628687103.A.A15.html
1F:推 robert09080: df.isin 看看能不能解决你的问题 08/11 22:12
2F:→ Talent14: 谢谢R大的资讯,我会再试试看! 08/11 23:11
3F:→ chickengod: df.loc[df.lo=='tw'].index.tolist() 08/12 07:57
4F:推 lycantrope: df.loc["C",:] 你都设定name 当index了 08/12 11:51
5F:→ Talent14: C大的方法可行!我会再查资料熟悉df方法,感谢帮忙! 08/12 20:04