Posts

Showing posts from November, 2020

6 Costly Numpy Mistakes to Avoid in Python

Image
  Numpy   is one of the most central   libraries   to   Python   but we all make simple mistakes, or we even make those mistakes that we know we shouldn’t make but still haven’t really figured out how to broach the subject. I’m a pretty average  programmer  and even now, I still fumble around with many problems that I face in  Python . So with that in mind, I decided to write down what common problems we face and how to go about them. It’s embarrassing to have lived through these: but here we go! 1: Lists or  Numpy  Arrays? When I st a rted  programming , I couldn’t figure out the difference and only when I began to use  matrix  methods did I really appreciate the difference here. Simply, a  List  is an ordered set of elements whereas, an  array  is a grid of values and it contains information about the raw data, how to locate an  element , and how to interpret an  element . Lists  are declared between by a pair of square brackets  [‘this is a list’]  whereas a  Numpy   Array  is defin