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)


暂无数据
推荐帖子
0条评论
0条评论
0条评论