I get the behavior by overloading the Series .__ get_attr__ method:
def my__getattr__(self, key): # If attribute is in the self Series instance ... if key in self: # ... return is as an attribute return self[key] else: # ... raise the usual exception raise AttributeError("'Series' object has no attribute '%s'" % key) # Overwrite current Series attributes 'else' case pandas.Series.__getattr__ = my__getattr__
Then I can access the Seriee elements with attributes:
xx = pandas.Series(dict(a=44, b=55)) xx.a
source share