Python Forum

Full Version: Time series
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hello, I'm a beginnr and I need help in the Map steps to dates
please help it's urgent!![attachment=1725][attachment=1725]


train = pd.read_csv('Train.csv')
print(train.shape)
train.head()
test = pd.read_csv('Test.csv')
print(test.shape)
test.head()
ss = pd.read_csv('SampleSubmission.csv')
print(ss.shape)
ss.head()
def process(train,test,ss) :
  
  target_mapper = dict(zip(ss.drop('ID',1).columns.tolist(),
                          [i for i in range(len(ss.drop('ID',1).columns.tolist()))]))  # Used to Encode Train Target 
  train['Target'] = train['Target'].map(target_mapper)
  
  Inversetarget_mapper = dict(zip([i for i in range(len(ss.drop('ID',1).columns.tolist()))],
                                  ss.drop('ID',1).columns.tolist())) # Used to Create submission file 

  in_cols = train.filter(like='timestep1_').columns.tolist() # features used in Training, we will use only time step 1 in this tutorial

  return target_mapper , Inversetarget_mapper , in_cols , train , test , ss