Python Program To Implement Matrix Cast