• illectrility@lemmy.worldOP
      link
      fedilink
      arrow-up
      1
      ·
      1 year ago

      When doing “import x as y”, x is the library (set of tools you can use in your program) you import and y is what you would call it throughout your code. This is helpful to shorten things, for example “import numpy as np”. Now you can just write “np” instead of “numpy”.

      In the image you would start every numpy statement with “pandas” and every pandas statement with “numpy”. It just makes it confusing.

    • Arinshot@lemmy.world
      link
      fedilink
      arrow-up
      1
      ·
      1 year ago

      Think of replacing the word “and” with the word “or”, and vise versa. Typically it will still make sense, bot not always