A traceback pointing at `name = input()` can end with `EOFError: EOF when reading a line`. The fact that one…
Browsing: Python
`np.sum(values)` returns `nan`, while `np.nansum(values)` returns `80.0` for the same array. I find that contrast useful because it shows how…
An IDE can run Python even when `where.exe python` returns no match in a separate shell. I’m intrigued that a…
An `import openpyxl` that succeeds still doesn’t tell you whether a new row made it into `orders.xlsx`. I like that…
Tourism is strongly affected by weather of a certain placeIt strongly impacts the safety and operation of transportation of all…
With `axis=0` on a 2×3 array, the result has one row index for each column. I like how that lets…
A complex value like `3 + 4j` comes back as `0.6 + 0.8j`, not a plain `1`. I was surprised…
A matrix of feature rows can produce one output from `np.linalg.norm(matrix)`, even when the next step needs a length for…
To convert a Python list into a NumPy array, call np.array() and pass dtype=np.float32 when you need that type. I…
pd.read_csv turns CSV rows into a DataFrame and infers a type for each column. I checked the output against product…
