<s>[INST] So, essentially I have two datasets (let's label them data1 and data2). Both these dataset would have shared (common) variables. My goal would be to compute mean, median and standard deviation etc. of different variables in both datasets together and separately.

If I had to manually compute these statistics one by one, I would manually match the column names between two datasets (e.g. data1 and data2), extract those values, and then compute statistic for each variable.

How can I automate this (identify common columns and compute statistics), especially using Python (Pandas)?[/INST]