I have a dataframe below for example
Name class roll subject
> Ab. 10. 23. maths
> CD. 3. 34. Science
I am using python 3.9
I need to check if a set of columns is present in the data set and if any columns is missing the column will be created and null will be assigned and should be dynamic
Example
I am checking if columns [Names,Class,roll,school,subject ]is in the dataset
If a column is not present it will created output will be below
Name class roll school subject
> Ab. 10. 23. NaN. Maths
> CD. 3. 34. NaN. Science
1