4 ms·
I'm not sure what you're referring to. Nothing you import into Python changes its syntax. Maybe you're thinking of things like x[:, np.newaxis] where x is a nu
by canjobear 5y ago
I'm not sure what you're referring to. Nothing you import into Python changes its syntax.
Maybe you're thinking of things like x[:, np.newaxis] where x is a numpy array? This is valid Python code outside of numpy as well, although the built-in data structures like lists and dicts won't know what to do with the :.
- wheelerof4te 5y agoTo be precise, you could model the same behavior on your custom types by using the dunder method magic. In that case, everything is "valid" Python code. Numpy and Pandas libraries have some non-standard ways to slice arrays, get the subarrays and the data from them.