I have following data frame (both columns str type):
+------+-----------------+
| year | indicator_short |
+------+-----------------+
| 2020 | ind_1 |
| 2019 | ind_2 |
| 2019 | ind_3 |
| N/A | ind_4 |
+------+-----------------+
I would like to add new column which will contain concatenation of two existing columns, but I would like them to be formatted like:
+------+-----------------+--------------------+
| year | indicator_short | indicator_full |
+------+-----------------+--------------------+
| 2020 | ind_1 | Indicator_1 (2020) |
| 2019 | ind_2 | Indicator_2 (2019) |
| 2019 | ind_3 | Indicator_3 (2019) |
| N/A | ind_4 | Indicator_4 (N/A) |
+------+-----------------+--------------------+
One thing is coming to my mind is use formatting, something like':
df['indicator_full'][df['indicator_short']=='ind_1'] = 'Indicator_1 ({})'.format(df['year'])
but it gives wrong result.