CSV文件为stack.csv
PROBLEM_CODE;OWNER_EMAIL;CALENDAR_YEAR;CALENDAR_QUARTER
CONFIG_ASSISTANCE;dalangle@gmail.com;2014;2014Q3
ERROR_MESSAGES;aganju@gmail.com;2014;2014Q3
PASSWORD_RECOV;dalangle@gmail.com;2014;2014Q3
ERROR_MESSAGES;biyma@gmail.com;2014;2014Q3
ERROR_MESSAGES;derrlee@gmail.com;2014;2014Q3
SOFTWARE_FAILURE;dalangle@gmail.com;2014;2014Q3
ERROR_MESSAGES;maariano@gmail.com;2014;2014Q3
SOFTWARE_FAILURE;dalangle@gmail.com;2014;2014Q3
我的代码:
import pandas as pd
import csv
data = pd.read_csv('stack.csv', sep='delimiter')
min_indices = (data['OWNER_EMAIL'] == dalangle@gmail.com)
data = data[min_indices]
data.to_csv('isabevdata.csv')
错误:
KeyError:'OWNER_EMAIL'
我需要使用pandas帮助这段代码。我想稍后从结果中删除一些列:isabevdata.csv
- >使用petl模块,然后将表发送到前端进行显示