Your confusion is about what the various commands in PDB do. I think of it a bit like a MUD and that works fairly often:
Use p to print out the contents of a variable (or pp to pretty-print (or handle your character's basic needs)):
(Pdb) p df
Empty DataFrame
Columns: [Dist, type, Count]
Index: []
Type where or w to see where you are on the stack:
(Pdb) w
-> return df[df['type']=='dev'][['Dist','Count']].as_matrix()
/home/user/core/ops.py(603)wrapper()
-> res = na_op(values, other)
> /home/user/core/ops.py(567)na_op()
-> raise TypeError("invalid type comparison")
See that little >
arrow? That's where we are in the stack.
Use list or l to look around:
(Pdb) list
564 try:
565 result = getattr(x, name)(y)
566 if result is NotImplemented:
567 >> raise TypeError("invalid type comparison")
568 except (AttributeError):
569 -> result = op(x, y)
570
571 return result
572
573 def wrapper(self, other):
574 if isinstance(other, pd.Series):
To move around in the stack continue MUDing and use up (u) or down (d).
Use args (a) to examine what arguments the current function was called with:
(Pdb) args
dat = array([], shape=(0, 3), dtype=float64)
dev_classes = {81, 82, 21, 22, 23, 24, 31}
Use interact to enter the code at the current point in the stack. Ctrl+D brings you back in to PDB.