Skip to main content
improved
Source Link
buhtz
  • 12.5k
  • 21
  • 95
  • 196

UYou can use Lambdalambda:

combine_lambda = lambda x: '{}{}'.format(x.Year, x.quaterquarter)

andAnd then use it with creating the new column:

df["period"]df['period'] = df.apply(combine_lambda, axis = 1)

U can use Lambda:

combine_lambda = lambda x: '{}{}'.format(x.Year, x.quater)

and then use it with creating the new column:

df["period"] = df.apply(combine_lambda, axis = 1)

You can use lambda:

combine_lambda = lambda x: '{}{}'.format(x.Year, x.quarter)

And then use it with creating the new column:

df['period'] = df.apply(combine_lambda, axis = 1)
Source Link
Pobaranchuk
  • 895
  • 11
  • 13

U can use Lambda:

combine_lambda = lambda x: '{}{}'.format(x.Year, x.quater)

and then use it with creating the new column:

df["period"] = df.apply(combine_lambda, axis = 1)