我想创建一个基于截止日期的状态,但在附加数据时遇到问题。我有从电子表格中提取的数据。你知道吗
我试过append函数,但它给了我错误。我在网上查过,但找不到该怎么做。你知道吗
#import pandas
import pandas as pd
import numpy as np
#Read Excel Sheet with Data
df = pd.read_csv('/Users/marvin-nonbusiness/Desktop/SHAREPOINT.csv')
#Show data
print(pd.isna(df))
print('-------------------------------------------------------------------------------------------')
print(df)
#Create Status
def marvin():
result = []
if pd.isna(row['pre boarded ']) == True and pd.isna(row['post boarded']) == False and pd.isna(row['remd reqd']) == True and pd.isna(row['sent to clc']) == True and pd.isna(row['review closed']) == True:
result.append('POST BOARDED STARTED')
elif pd.isna(row['pre boarded ']) == True and pd.isna(row['post boarded']) == False and pd.isna(row['remd reqd']) == False and pd.isna(row['sent to clc']) == True and pd.isna(row['review closed']) == True:
result.append('REMEDIATION REQD-PENDING LOG TO CLC')
elif pd.isna(row['pre boarded ']) == True and pd.isna(row['post boarded']) == False and pd.isna(row['remd reqd']) == False and pd.isna(row['sent to clc']) == False and pd.isna(row['review closed']) == True:
result.append('REMEDIATION REQD-SENT TO CLC')
elif pd.isna(row['pre boarded ']) == True and pd.isna(row['post boarded']) == False and pd.isna(row['remd reqd']) == False and pd.isna(row['sent to clc']) == False and pd.isna(row['review closed']) == False:
result.append('REVIEW COMPLETED-ISSUES FOUND')
else:
result.append('DATE EXCEPTION')
df.append(marvin())
df
print('executed')
现在有4列没有状态。你知道吗
预期的结果将是5列和一个状态列
我相信你需要:
您的解决方案应该由^{} 重写:
相关问题 更多 >
编程相关推荐