It would be more idiomatic Python to use a context manager for the file. This also currently keeps the file handler open while we do other operations on the loaded data; I think you see that happen less when using a context manager, too. -- @ijl