merge_machine/abstract_data_project.py
def _static_load_data(self, file_path, nrows=None, columns=None): 
        '''
        Load a pandas DataFrame into memory from a csv in file_path. dtype will 
        be str by default except for some column names with '__'. This function 
        is intended to be used to read results of normalization and/or matching.
        Only the first rows will be read (the number of rows being self.CHUNKSIZE)
        
        INPUT:
            file_path: path to csv file
            nrows: number of rows to read
            columns: columns to load
        
        OUTPUT:
            tab: pandas DataFrame
        '''
        if columns is None:
            columns = pd.read_csv(file_path, encoding='utf-8', dtype=str, 
                                  nrows=0, usecols=columns).columns
            
        dtype = {col: self._choose_dtype(col) for col in columns}

        if nrows is not None:
            logging.debug('Nrows is: {0}'.format(nrows))
            tab = pd.read_csv(file_path, encoding='utf-8', dtype=dtype, 
                                nrows=nrows, usecols=columns, chunksize=self.CHUNKSIZE)
        else:
            tab = pd.read_csv(file_path, encoding='utf-8', dtype=dtype, 
                                        usecols=columns, chunksize=self.CHUNKSIZE)

        return tab

        Load a pandas DataFrame into memory from a csv in file_path. dtype will 
        be str by default except for some column names with '__'. This function 
        is intended to be used to read results of normalization and/or matching.
        Only the first rows will be read (the number of rows being self.CHUNKSIZE)
        
        INPUT:
            file_path: path to csv file
            nrows: number of rows to read
            columns: columns to load
        
        OUTPUT:
            tab: pandas DataFrame
        
Load a pandas DataFrame into memory from a csv in file_path. dtype will
be str by default except for some column names with '__'. This function
is intended to be used to read results of normalization and/or matching.
Only the first rows will be read (the number of rows being self.CHUNKSIZE)

path to csv file
nrows: number of rows to read
columns: columns to load


Load a pandas DataFrame into memory from a csv in file_path . dtype will be str by default except for some column names with ' __ ' . This function is intended to be used to read results of normalization and / or matching . Only the first rows will be read ( the number of rows being self . CHUNKSIZE ) path to csv file nrows : number of rows to read columns : columns to load
def _static_load_data(self, file_path, nrows=None, columns=None): 
        if columns is None:
            columns = pd.read_csv(file_path, encoding='utf-8', dtype=str, 
                                  nrows=0, usecols=columns).columns
        dtype = {col: self._choose_dtype(col) for col in columns}
        if nrows is not None:
            logging.debug('Nrows is: {0}'.format(nrows))
            tab = pd.read_csv(file_path, encoding='utf-8', dtype=dtype, 
                                nrows=nrows, usecols=columns, chunksize=self.CHUNKSIZE)
        else:
            tab = pd.read_csv(file_path, encoding='utf-8', dtype=dtype, 
                                        usecols=columns, chunksize=self.CHUNKSIZE)
        return tab
def _static_load_data ( self , file_path , nrows = None , columns = None ) : if columns is None : columns = pd . read_csv ( file_path , encoding = 'utf-8' , dtype = str , nrows = 0 , usecols = columns ) . columns dtype = { col : self . _choose_dtype ( col ) for col in columns } if nrows is not None : logging . debug ( 'Nrows is: {0}' . format ( nrows ) ) tab = pd . read_csv ( file_path , encoding = 'utf-8' , dtype = dtype , nrows = nrows , usecols = columns , chunksize = self . CHUNKSIZE ) else : tab = pd . read_csv ( file_path , encoding = 'utf-8' , dtype = dtype , usecols = columns , chunksize = self . CHUNKSIZE ) return tab
Load a pandas DataFrame into memory from a csv in file_path.
Load a pandas DataFrame into memory from a csv in file_path .
'''
        Load a pandas DataFrame into memory from a csv in file_path. dtype will 
        be str by default except for some column names with '__'. This function 
        is intended to be used to read results of normalization and/or matching.
        Only the first rows will be read (the number of rows being self.CHUNKSIZE)
        
        INPUT:
            file_path: path to csv file
            nrows: number of rows to read
            columns: columns to load
        
        OUTPUT:
            tab: pandas DataFrame
        '''
self
file_path
nrows
columns