(self, name, fpath, na_values=None, entity_col=None, src_col=None)
return status, load_time
load_data takes a CSV file of the initial data, adds tuple IDs (_tid_)
        to each row to uniquely identify an 'entity', and generates unique
        index numbers for each attribute/column.

        Creates a table with the user supplied 'name' parameter (e.g. 'hospital').

        :param name: (str) name to initialize dataset with.
        :param fpath: (str) filepath to CSV file.
        :param na_values: (str) value that identifies a NULL value
        :param entity_col: (str) column containing the unique
            identifier/ID of an entity.  For fusion tasks, rows with
            the same ID will be fused together in the output.
            If None, assumes every row is a unique entity.
        :param src_col: (str) if not None, for fusion tasks
            specifies the column containing the source for each "mention" of an
            entity.
load_data takes a CSV file of the initial data, adds tuple IDs (_tid_)
        to each row to uniquely identify an 'entity', and generates unique
        index numbers for each attribute/column.
load_data takes a CSV file of the initial data adds tuple IDs ( _tid_ ) to each row to uniquely identify an entity and generates unique index numbers for each attribute / column .
def load_data(self, name, fpath, na_values=None, entity_col=None, src_col=None):
        """
        load_data takes a CSV file of the initial data, adds tuple IDs (_tid_)
        to each row to uniquely identify an 'entity', and generates unique
        index numbers for each attribute/column.

        Creates a table with the user supplied 'name' parameter (e.g. 'hospital').

        :param name: (str) name to initialize dataset with.
        :param fpath: (str) filepath to CSV file.
        :param na_values: (str) value that identifies a NULL value
        :param entity_col: (str) column containing the unique
            identifier/ID of an entity.  For fusion tasks, rows with
            the same ID will be fused together in the output.
            If None, assumes every row is a unique entity.
        :param src_col: (str) if not None, for fusion tasks
            specifies the column containing the source for each "mention" of an
            entity.
        """
        tic = time.clock()
        try:
            # Do not include TID and source column as trainable attributes
            exclude_attr_cols = ['_tid_']
            if src_col is not None:
                exclude_attr_cols.append(src_col)

            # Load raw CSV file/data into a Postgres table 'name' (param).
            self.raw_data = Table(name, Source.FILE, na_values=na_values, exclude_attr_cols=exclude_attr_cols, fpath=fpath)

            df = self.raw_data.df
            # Add _tid_ column to dataset that uniquely identifies an entity.
            # If entity_col is not supplied, use auto-incrementing values.
            # Otherwise we use the entity values directly as _tid_'s.
            if entity_col is None:
                # auto-increment
                df.insert(0, '_tid_', range(0,len(df)))
            else:
                # use entity IDs as _tid_'s directly
                df.rename({entity_col: '_tid_'}, axis='columns', inplace=True)

            # Use NULL_REPR to represent NULL values
            df.fillna(NULL_REPR, inplace=True)

            logging.info("Loaded %d rows with %d cells", self.raw_data.df.shape[0], self.raw_data.df.shape[0] * self.raw_data.df.shape[1])

            # Call to store to database
            self.raw_data.store_to_db(self.engine.engine)
            status = 'DONE Loading {fname}'.format(fname=os.path.basename(fpath))

            # Generate indexes on attribute columns for faster queries
            for attr in self.raw_data.get_attributes():
                # Generate index on attribute
                self.raw_data.create_db_index(self.engine,[attr])

            # Create attr_to_idx dictionary (assign unique index for each attribute)
            # and attr_count (total # of attributes)
            self.attr_to_idx = {attr: idx for idx, attr in enumerate(self.raw_data.get_attributes())}
            self.attr_count = len(self.attr_to_idx)
        except Exception:
            logging.error('loading data for table %s', name)
            raise
        toc = time.clock()
        load_time = toc - tic
        return status, load_time
def load_data ( self , name , fpath , na_values = None , entity_col = None , src_col = None ) : tic = time . clock ( ) try : # Do not include TID and source column as trainable attributes exclude_attr_cols = [ '_tid_' ] if src_col is not None : exclude_attr_cols . append ( src_col ) # Load raw CSV file/data into a Postgres table 'name' (param). self . raw_data = Table ( name , Source . FILE , na_values = na_values , exclude_attr_cols = exclude_attr_cols , fpath = fpath ) df = self . raw_data . df # Add _tid_ column to dataset that uniquely identifies an entity. # If entity_col is not supplied, use auto-incrementing values. # Otherwise we use the entity values directly as _tid_'s. if entity_col is None : # auto-increment df . insert ( 0 , '_tid_' , range ( 0 , len ( df ) ) ) else : # use entity IDs as _tid_'s directly df . rename ( { entity_col : '_tid_' } , axis = 'columns' , inplace = True ) # Use NULL_REPR to represent NULL values df . fillna ( NULL_REPR , inplace = True ) logging . info ( "Loaded %d rows with %d cells" , self . raw_data . df . shape [ 0 ] , self . raw_data . df . shape [ 0 ] * self . raw_data . df . shape [ 1 ] ) # Call to store to database self . raw_data . store_to_db ( self . engine . engine ) status = 'DONE Loading {fname}' . format ( fname = os . path . basename ( fpath ) ) # Generate indexes on attribute columns for faster queries for attr in self . raw_data . get_attributes ( ) : # Generate index on attribute self . raw_data . create_db_index ( self . engine , [ attr ] ) # Create attr_to_idx dictionary (assign unique index for each attribute) # and attr_count (total # of attributes) self . attr_to_idx = { attr : idx for idx , attr in enumerate ( self . raw_data . get_attributes ( ) ) } self . attr_count = len ( self . attr_to_idx ) except Exception : logging . error ( 'loading data for table %s' , name ) raise toc = time . clock ( ) load_time = toc - tic return status , load_time