0

I am calculating a new column in dataframe using the below logic

import datetime
import pandas as pd
# BDay is business day, not birthday...
from pandas.tseries.offsets import BDay
df.StartDate_Prior = (df.StartDate - BDay(1))

df.StartDate
0    2020-11-24
1    2020-11-19
2    2020-11-09
3    2020-11-10
4    2020-11-12

But when I try select the datafrme Like below

df13[['StartDate_Prior','fyPlannedStartDate']]

Error:

"['StartDate_Prior'] not in index"

How to fix this?

0 Answers0