I am having a doubt that though creating a subset of dataframe just creates a view of dataframe then why it didnt change value in original dataframe?

It is just a warning that chained-indexing is detected . So try to use .loc method to reassign a value this could change the value in original DataFrame also. If I am wrong try to correct me.