MCPcopy
hub / github.com/pandas-dev/pandas / indexables

Method indexables

pandas/io/pytables.py:4987–5019  ·  view source on GitHub ↗

create the indexables from the table description

(self)

Source from the content-addressed store, hash-verified

4985
4986 @cache_readonly
4987 def indexables(self):
4988 """create the indexables from the table description"""
4989 d = self.description
4990
4991 # TODO: can we get a typ for this? AFAICT it is the only place
4992 # where we aren't passing one
4993 # the index columns is just a simple index
4994 md = self.read_metadata("index")
4995 meta = "category" if md is not None else None
4996 index_col = GenericIndexCol(
4997 name="index", axis=0, table=self.table, meta=meta, metadata=md
4998 )
4999
5000 _indexables: list[GenericIndexCol | GenericDataIndexableCol] = [index_col]
5001
5002 for i, n in enumerate(d._v_names):
5003 assert isinstance(n, str)
5004
5005 atom = getattr(d, n)
5006 md = self.read_metadata(n)
5007 meta = "category" if md is not None else None
5008 dc = GenericDataIndexableCol(
5009 name=n,
5010 pos=i,
5011 values=[n],
5012 typ=atom,
5013 table=self.table,
5014 meta=meta,
5015 metadata=md,
5016 )
5017 _indexables.append(dc)
5018
5019 return _indexables
5020
5021 # error: Signature of "write" incompatible with supertype "AppendableTable"
5022 def write(self, **kwargs) -> None: # type: ignore[override]

Callers

nothing calls this directly

Calls 4

GenericIndexColClass · 0.85
read_metadataMethod · 0.80
appendMethod · 0.45

Tested by

no test coverage detected