Solved by raghadalghonaim in post #3 
              
              
                Thanks for your response. 
I figured out the problem, I was using list to store the data instead of NumPy Array. 
I documented everything I tried in this post, if someone is interested: