热线电话:13121318867

登录
2019-02-21 阅读量: 651
python如何检索迭代行

可以应用例如iteritems()函数来检索一行数据框:

# importing pandas as pd

import pandas as pd

# dictionary of lists

dict = {'name':["aparna", "pankaj", "sudhir", "Geeku"],

'degree': ["MBA", "BCA", "M.Tech", "MBA"],

'score':[90, 40, 80, 98]}

# craeting a dataframe from a dictionary

df = pd.DataFrame(dict)

# using iteritems() function to retrieve rows

for key, value in df.iteritems():

print(key, value)

print()

0.0000
1
关注作者
收藏
评论(0)

发表评论

暂无数据
推荐帖子