Public Member Functions | Private Member Functions | Private Attributes | Static Private Attributes | List of all members
PandAna.core.core.dfproxy Class Reference
Inheritance diagram for PandAna.core.core.dfproxy:

Public Member Functions

def __init__ (self, data=[], kwargs)
 
def __getitem__ (self, key)
 
def __setitem__ (self, key, val)
 

Private Member Functions

def _constructor (self)
 

Private Attributes

 _proxycols
 

Static Private Attributes

 _internal_names = pd.DataFrame._internal_names+['_proxycols']
 
 _internal_names_set = set(_internal_names)
 

Detailed Description

Definition at line 344 of file core.py.

Constructor & Destructor Documentation

def PandAna.core.core.dfproxy.__init__ (   self,
  data = [],
  kwargs 
)

Definition at line 354 of file core.py.

354  def __init__(self, data=[], **kwargs):
355  pd.DataFrame.__init__(self, data, **kwargs)
356  self._proxycols = list(self.columns.values)
357 
def __init__(self, data=[], kwargs)
Definition: core.py:354

Member Function Documentation

def PandAna.core.core.dfproxy.__getitem__ (   self,
  key 
)

Definition at line 358 of file core.py.

References PandAna.core.core.dfproxy.__getitem__(), PandAna.core.core.dfproxy.__setitem__(), and PandAna.core.core.dfproxy._proxycols.

Referenced by PandAna.core.core.dfproxy.__getitem__().

358  def __getitem__(self, key):
359  # add the column
360  if type(key) is str and not key in self._proxycols:
361  self._proxycols.append(key)
362  self.__setitem__(key, np.nan)
363  return self.__getitem__(key)
364  # or all the columns
365  if type(key) is list and not set(key)<=set(self._proxycols):
366  for k in key:
367  self._proxycols.append(k)
368  self.__setitem__(k, np.nan)
369  return self.__getitem__(key)
370  # assume dataframe is being sliced inside cut/var, don't do anything
371  if type(key) is not str and type(key) is not list:
372  return self
373  return pd.DataFrame.__getitem__(self, key)
374 
def __setitem__(self, key, val)
Definition: core.py:375
def __getitem__(self, key)
Definition: core.py:358
def PandAna.core.core.dfproxy.__setitem__ (   self,
  key,
  val 
)

Definition at line 375 of file core.py.

Referenced by PandAna.core.core.dfproxy.__getitem__().

375  def __setitem__(self, key, val):
376  pd.DataFrame.__setitem__(self, key, val)
377 
def __setitem__(self, key, val)
Definition: core.py:375
def PandAna.core.core.dfproxy._constructor (   self)
private

Definition at line 351 of file core.py.

351  def _constructor(self):
352  return dfproxy
353 
def _constructor(self)
Definition: core.py:351

Member Data Documentation

PandAna.core.core.dfproxy._internal_names = pd.DataFrame._internal_names+['_proxycols']
staticprivate

Definition at line 345 of file core.py.

PandAna.core.core.dfproxy._internal_names_set = set(_internal_names)
staticprivate

Definition at line 346 of file core.py.

PandAna.core.core.dfproxy._proxycols
private

Definition at line 356 of file core.py.

Referenced by PandAna.core.core.dfproxy.__getitem__().


The documentation for this class was generated from the following file: