[英]Extract excel column values based on other column values using script
你能在你的 excel 文件上運行它嗎?
import pandas as pd
df = pd.read_excel('book1.xlsx')
comment_to_teams = {}
for comment, rows in df.groupby('Comment'):
comment_to_teams[comment] = rows[['Name', 'Port']]
for comment, teams in comment_to_teams.items():
print(comment)
print(teams)
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.