Joseph Chu's Blog

积极勤奋,主动勇敢


  • Home

  • Archives

  • Tags

  • Categories

  • About

  • Search

Pandas 遍历Dataframe

Posted on 2018-12-18 | Edited on 2018-12-31 | In Python Package Usage

可以采用df.iterrows()函数

设有如下df

1
2
    target    text
0 1 "blahblah"

则遍历方式如下

1
2
3
for index, row in df.iterrows():
print(index) # 0
print(row["target"]) # 1
# Pandas
Pandas学习资源
Numpy 改变数组的shape

Joseph Chu

一日之功很有限,不过可以积少成多
72 posts
17 categories
50 tags
© 2019 Joseph Chu
Powered by Hexo v3.6.0
|
Theme – NexT.Pisces v7.0.1