Applies the natural logarithm function to turn positive values into real ranged values.

        Args:
            column (pandas.DataFrame): Data to transform.

        Returns:
            pd.DataFrame
182052
def reverse_transform(self, column):
        
        self.check_data_type()

        return pd.DataFrame({self.col_name: np.log(column[self.col_name])})
528216
def fit_transform(self, input_df, normalize=True):
        
        # Shallow copy the dataframe (we'll be making changes to some columns)
        _df = input_df.copy(deep=False)

        # Set class variables that will be used both now and later for transform
        self.normalize = normalize

        # Convert columns that are probably categorical
        self.convert_to_categorical(_df)

        # First check for columns that are explicitly categorical
        self.cat_columns = _df.select_dtypes(include=['category']).columns.tolist()

        # Remove any columns that aren't bool/int/float/category
        _df = _df.select_dtypes(include=['bool', 'int', 'float', 'category'])

        # Normalize any numeric columns if normalize specified
        if self.normalize:
            for column in list(_df.select_dtypes(include=[np.number]).columns.values):
                print('Normalizing column {:s}...'.format(column))
                _df[column], _min, _max = self._normalize_series(_df[column])
                self.norm_map[column] = (_min, _max)

        # Now that categorical columns are setup call the dummy_encoder
        return self.dummy_encoder.fit_transform(_df)
541057
def convert_column(self, values):
        """"""
        assert all(values >= 0), 'Cannot normalize a column with negatives'
        total = sum(values)
        if total > 0:
            return values / total
        else:
            return values
1024801
def get_column(self, column):
        
        if "(" in str(column):
            temp_list = column.split("(")
            key = temp_list[1].strip("()")
            func = temp_list[0].lower()
        else:
            key = column
            func = None

        if "." not in key:
            for i in self.columns:
                if i.split(".")[1] == key:
                    key = i
                    break

        col = map(
            lambda x: x.get(
                key
            ),
            self.rows
        )

        if func is not None:
            if func == "sum":
                return [sum(col)]
            elif func == "max":
                return [max(col)]
            elif func == "min":
                return [min(col)]
            elif func == "avg":
                return [sum(col) / float(len(col))]
            elif func == "count":
                return [len(col)]
            elif func == "distinct":
                return list(set(col))
            else:
                raise Exception(
                    "Unknown function called on column"
                )

        return col
713186
public SparseDoubleVector getColumnVector(int column) {
        SparseDoubleVector values = new SparseHashDoubleVector(rows);
        for (int row = 0; row < rows; ++row) {
            double d = get(row, column);
            if (d != 0)
                values.set(row, d);
        }
        return values;
    }
953730
def transform(self, input_df):
        

        # Shallow copy the dataframe (we'll be making changes to some columns)
        _df = input_df.copy(deep=False)

        # Convert all columns that are/should be categorical
        for column in self.cat_columns:

            # Sanity check
            if column not in _df:
                raise RuntimeError('Required column {:s} not found'.format(column))

            # If the column isn't already a category then change it
            if _df[column].dtype == 'object':
                print('Changing column {:s} to category'.format(column))
                _df[column] = pd.Categorical(_df[column])

        # Remove any columns that aren't bool/int/float/category
        _df = _df.select_dtypes(include=['bool', 'int', 'float', 'category'])

        # Normalize any numeric columns if normalize specified
        if self.normalize:
            for column in list(_df.select_dtypes(include=[np.number]).columns.values):
                print('Normalizing column {:s}...'.format(column))
                smin, smax = self.norm_map[column]
                _df[column] = (_df[column] - smin) / (smax - smin)

        # Now that categorical columns are setup call the dummy_encoder
        return self.dummy_encoder.transform(_df)
720904
def process_column(self, column):
        
        processed_column = DatasetColumn(
            name=self.get_or_fail(column, 'name'),
            description=self.get_or_default(column, 'description', ''))
        if 'type' in column:
            original_type = column['type'].lower()
            processed_column.original_type = original_type
            if (original_type == 'string' or original_type == 'date'
                    or original_type == 'time' or original_type == 'yearmonth'
                    or original_type == 'duration'
                    or original_type == 'geopoint'
                    or original_type == 'geojson'):
                processed_column.type = 'string'
            elif (original_type == 'numeric' or original_type == 'number'
                  or original_type == 'year'):
                processed_column.type = 'numeric'
            elif original_type == 'boolean':
                processed_column.type = 'boolean'
            elif original_type == 'datetime':
                processed_column.type = 'datetime'
            else:
                # Possibly extended data type - not going to try to track those
                # here. Will set the type and let the server handle it.
                processed_column.type = original_type
        return processed_column
1270735
def to_datetime(self, column):
        '''
        
        '''
        if column in self:
            if self[column].dtype in NUMPY_NUMERICAL:
                self[column] = pd.to_datetime(self[column], unit='s')
            else:
                self[column] = pd.to_datetime(self[column], utc=True)
1032632
def fillNoneValues(column):
    
    if column.dtype == object:
        column.fillna('', inplace=True)
    return column
1269381
def upregulated(self, thresh=0.05, idx=True):
        
        ind = (
            (self.data[self.pval_column] <= thresh)
            & (self.data[self.lfc_column] > 0)
        )
        if idx:
            return ind
        return self[ind]
255393
def nowrange(self, col, timeframe):
        
        df = self._nowrange(col, timeframe)
        if df is None:
            self.err("Can not select range data from now")
            return
        self.df = df
187900
def get_column(self, column):
		
		if column.lower() == 'q':
			return self.get_q
		else:
			return self.getColumnByName(column).asarray()
893760
def _lognl(self):
        
        try:
            return self.__lognl
        except AttributeError:
            det_lognls = {}
            for (det, d) in self._data.items():
                kmin = self._kmin
                kmax = self._kmax
                det_lognls[det] = -0.5 * d[kmin:kmax].inner(d[kmin:kmax]).real
            self.__det_lognls = det_lognls
            self.__lognl = sum(det_lognls.values())
            return self.__lognl
432277
def logscale(x_min, x_max, n):
    
    if not (isinstance(n, int) and n > 0):
        raise ValueError('n must be a positive integer, got %s' % n)
    if x_min <= 0:
        raise ValueError('x_min must be positive, got %s' % x_min)
    if x_max <= x_min:
        raise ValueError('x_max (%s) must be bigger than x_min (%s)' %
                         (x_max, x_min))
    delta = numpy.log(x_max / x_min)
    return numpy.exp(delta * numpy.arange(n) / (n - 1)) * x_min
697275
public java.math.BigDecimal getBigDecimal(String column) {
		return (java.math.BigDecimal)getColumns().get(column);
	}
39051
def fit_transform(self, col):
        

        if self.anonymize:
            col = self.anonymize_column(col)

        self._fit(col)
        return self.transform(col)
1250020
def _get_s(cls, df, column, shifts):
        
        shift = cls.to_int(shifts)
        shifted_key = "{}_{}_s".format(column, shift)
        df[shifted_key] = df[column].shift(-shift)
        StockDataFrame.set_nan(df[shifted_key], shift)