• Kerb
    link
    fedilink
    72 years ago

    Import pandas as np
    Import numpy as tf
    Import matplotlib.pyplotlib as pd
    Import tensorflow as plt

    Or if your more of a c++ guy:

    #define true false
    #define false true

    • illectrilityOP
      link
      22 years 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.

    • @[email protected]
      link
      fedilink
      12 years ago

      numpy and pandas are two different modules that have similar uses, but are most definitely not interchangeable. Line 500 is importing numpy, but calling it pandas. Meaning later on in the code, any time the script makes use of numpy, it actually has to refer to it as pandas, and vice versa, causing all sorts of confusion and shenanigans.

      • @[email protected]
        link
        fedilink
        22 years ago

        I feel like there should be an award for the most interesting error code, regardless of how highly subjective that is.

    • @Arinshot
      link
      12 years ago

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