I have a dataset where I would like to append rows if this value is missing from a specific column.
Data
ID Date type energy
AA Q1 2022 a 1
AA Q2 2022 ok 1
AA Q3 2022 yes 1
AA Q4 2022 yes 4
FC Q1 2022 no 4
FC Q2 2022 no 4
FC Q3 2022 yes 45
FC Q4 2022 yes 5
Desired
ID Date type energy
AA Q1 2022 a 1
AA Q2 2022 ok 1
AA Q3 2022 yes 1
AA Q4 2022 yes 4
FC Q1 2022 no 4
FC Q2 2022 no 4
FC Q3 2022 yes 45
FC Q4 2022 yes 5
BC Q1 2022 0
DA Q1 2022 0
Doing
#values = {'BC': 'Q1 2022', 'DA': 'Q1 2022}
#df1 = df.merge(df, how='left').fillna({'energy': 0})
However, this is not appending, not sure how to attach the values dictionary within this script. I am still researching, any assistance is appreciated.