4 ms·
I like using NamedTuple for dot notation access, it's a good middle ground between dicts and custom classes. Pandas must use something similar under the hood t
by an_hn_reader 9y ago
I like using NamedTuple for dot notation access, it's a good middle ground between dicts and custom classes.
Pandas must use something similar under the hood to provide dot notation access to columns. I wish h5py did the same for hdf5 objects. In py3, I find myself needing to type list(X.items()) and then list(X['Y'].items()) and so on when I'm exploring a new dataset... fairly awkward for interactive use.
- mythrwy 9y agoThumbs up for namedtuple. It is a good middle ground.