Python Code For Relational Frame