Fill empty values with NaN values

        :param col: name of the colum
        :type col: str

        :example: ``ds.nan_empty("mycol")``
767870
def nan_empty(self, col: str):
        
        try:
            self.df[col] = self.df[col].replace('', nan)
            self.ok("Filled empty values with nan in column " + col)
        except Exception as e:
            self.err(e, "Can not fill empty values with nan")
1032632
def fillNoneValues(column):
    
    if column.dtype == object:
        column.fillna('', inplace=True)
    return column
346395
def insert_data_frame(col, df, int_col=None, binary_col=None, minimal_size=5):
    
    data = transform.to_dict_list_generic_type(df,
                                               int_col=int_col,
                                               binary_col=binary_col)
    smart_insert(col, data, minimal_size)
124508
def transform(self, col):
        

        out = pd.DataFrame()

        # Make sure all nans are handled the same by replacing with None
        column = col[self.col_name].replace({np.nan: None})
        out[self.col_name] = column.apply(self.get_val)

        return out
723574
def col_append(self, col_key, value_list):
        
        if col_key in self._col_keys:
            raise KeyError('Key %s already exists col keys.' % col_key)
        if not isinstance(value_list, (tuple, list)):
            value_list = [value_list] * len(self._row_keys)
        if not len(value_list) == len(self._row_keys):
            raise ValueError('Length of data to set does not meet expected col length of %i' % len(self._row_keys))
        self._col_keys.append(col_key)
        for r, v in zip(self._row_keys, value_list):
            self[r, col_key] = v
1183723
public void setColumn(int col, double[] values) {
    int offset = translate(0, col, numRows);
    System.arraycopy(values, 0, matrix, offset, values.length);
  }
713876
def insert_empty_columns(self, x: int, amount: int = 1) -> None:
        """"""
        def transform_columns(
                column: Union[int, float],
                row: Union[int, float]
        ) -> Tuple[Union[int, float], Union[int, float]]:
            return column + (amount if column >= x else 0), row
        self._transform_coordinates(transform_columns)
375351
def drop_nan_columns(df, thresh=325):
    
    if thresh < 1:
        thresh = int(thresh * df)
    return df.dropna(axis=1, thresh=thresh, inplace=False)
669381
def update_col(input, **params):
    
    PARAM_TARGET = 'target'
    PARAM_UPDATE = 'update'
    SOURCE_TYPE = 'src.type'
    SOURCE_COL = 'src.col'
    SOURCE_FIELD = 'src.field'
    DEST_FIELD = 'dest.field'
    SOURCE_TYPE_DOC = 'doc'
    SOURCE_TYPE_CONST = 'const'
    CONST_VALUE = 'const.value'

    update_list = params.get(PARAM_UPDATE)
    res = input[params.get(PARAM_TARGET)] if PARAM_TARGET in params else input
    for row in res:
        for update_desc in update_list:
            if update_desc[SOURCE_TYPE] == SOURCE_TYPE_DOC:
                row[update_desc[DEST_FIELD]] = input[update_desc[SOURCE_COL]][update_desc[SOURCE_FIELD]]
            elif update_desc[SOURCE_TYPE] == SOURCE_TYPE_CONST:
                row[update_desc[DEST_FIELD]] = update_desc[CONST_VALUE]
    return res
64270
def fill_cells(self, dialect, has_header, choices=True):
        

        # Get columns from csv
        first_line = get_first_line(self.csvfilepath, dialect)
        self.shape[1] = no_cols = len(first_line)

        if no_cols > self.GetNumberCols():
            missing_cols = no_cols - self.GetNumberCols()
            self.AppendCols(missing_cols)

        elif no_cols < self.GetNumberCols():
            obsolete_cols = self.GetNumberCols() - no_cols
            self.DeleteCols(pos=no_cols - 1, numCols=obsolete_cols)

        # Retrieve type choices
        digest_keys = self.get_digest_keys()

        # Is a header present? --> Import as strings in first line
        if has_header:
            for i, header in enumerate(first_line):
                self.SetCellValue(0, i, header)

        if choices:
            # Add Choices
            for col in xrange(self.shape[1]):
                choice_renderer = ChoiceRenderer(self)
                choice_editor = wx.grid.GridCellChoiceEditor(
                    self.digest_types.keys(), False)
                self.SetCellRenderer(has_header, col, choice_renderer)
                self.SetCellEditor(has_header, col, choice_editor)
                self.SetCellValue(has_header, col, digest_keys[col])

        # Fill in the rest of the lines

        self.dtypes = []
        for key in self.get_digest_keys():
            try:
                self.dtypes.append(self.digest_types[key])
            except KeyError:
                self.dtypes.append(types.NoneType)

        topleft = (has_header + 1, 0)

        digest_gen = csv_digest_gen(self.csvfilepath, dialect, has_header,
                                    self.dtypes)

        for row, col, val in cell_key_val_gen(digest_gen, self.shape, topleft):
            self.SetCellValue(row, col, val)

        self.Refresh()
28538
public Object[] valuesForColumns(T bo, String... columns) {
        Map<String, ColAttrMapping> columnAttributeMappings = getColumnAttributeMappings();
        Object[] result = new Object[columns.length];
        for (int i = 0; i < columns.length; i++) {
            ColAttrMapping colAttrMapping = columnAttributeMappings.get(columns[i]);
            try {
                result[i] = colAttrMapping != null ? colAttrMapping.extractAttrValue(bo) : null;
            } catch (Exception e) {
                throw e instanceof RuntimeException ? (RuntimeException) e
                        : new RuntimeException(e);
            }
        }
        return result;
    }
508468
def label_from_df(self, cols:IntsOrStrs=1, label_cls:Callable=None, **kwargs):
        ""
        labels = self.inner_df.iloc[:,df_names_to_idx(cols, self.inner_df)]
        assert labels.isna().sum().sum() == 0, f"You have NaN values in column(s) {cols} of your dataframe, please fix it."
        if is_listy(cols) and len(cols) > 1 and (label_cls is None or label_cls == MultiCategoryList):
            new_kwargs,label_cls = dict(one_hot=True, classes= cols),MultiCategoryList
            kwargs = {**new_kwargs, **kwargs}
        return self._label_from_list(_maybe_squeeze(labels), label_cls=label_cls, **kwargs)
1034807
def _extract_colnum(self, col):
        
        if isinteger(col):
            colnum = col

            if (colnum < 0) or (colnum > (self._ncol-1)):
                raise ValueError(
                    "column number should be in [0,%d]" % (0, self._ncol-1))
        else:
            colstr = mks(col)
            try:
                if self.case_sensitive:
                    mess = "column name '%s' not found (case sensitive)" % col
                    colnum = self._colnames.index(colstr)
                else:
                    mess \
                        = "column name '%s' not found (case insensitive)" % col
                    colnum = self._colnames_lower.index(colstr.lower())
            except ValueError:
                raise ValueError(mess)
        return int(colnum)
758890
def row_from_cols(self, values):
		
		row = self.RowType()
		for c, t, v in zip(self.dbcolumnnames, self.dbcolumntypes, values):
			if t in ligolwtypes.IDTypes:
				v = ilwd.ilwdchar(v)
			setattr(row, c, v)
		return row
892778
def extract_col(self, col):
        
        new_col = [row[col] for row in self.grid]
        return new_col
1348167
def to_float(self, col: str, **kwargs):
        
        try:
            self.df[col] = self.df[col].astype(np.float64, **kwargs)
            self.ok("Converted column values to float")
        except Exception as e:
            self.err(e, "Error converting to float")
130238
def none_missing(df, columns=None):
    
    if columns is None:
        columns = df.columns
    try:
        assert not df[columns].isnull().any().any()
    except AssertionError as e:
        missing = df[columns].isnull()
        msg = generic.bad_locations(missing)
        e.args = msg
        raise
    return df