def dummies(x, dummies = True, codes = False, freq = True, na = "inplace", nanew = True, col = None, ascending = True, cat = True, drop = True,
           ids = False):
    try:
        if dtypes(x)[0]==('int' or 'float') and type(x)==pd.Series: return x
    except:
        if dtypes(x)==('int' or 'float') and type(x)==pd.Series: return x
    if type(x)!=pd.DataFrame: x = table(x)
    df = copy(x)
    if ids == False: df = exc(df, isid(df))
    if col is None: 
        if cat == True: col = catcol(df)
        else: col = objcol(df)
    elif type(col)!=list: col = [col]
    if dummies == True:
        if "in" in na:
            for j in col:
                dummified = pd.get_dummies(x[j], dummy_na = nanew)
                dummified.columns = [str(j)+"_"+str(c) for c in columns(dummified)]
                if j in nacol(x): dummified.iloc[isnull(x[j]).index]=np.nan
                df = hcat(df, dummified)
        else: df = pd.get_dummies(x, dummy_na = nanew, columns = col)
        if drop == True: return notobj(zerodrop(df))
        else: return zerodrop(df)
    else:
        if freq == True:
            code = {}
            for j in col:
                part = {}; 
                try: i = min(df[j]);
                except: i = 0;
                if dtype(df[j])!=('int'or'float'): d = fsort(df, by = j)[j]
                else: d = sort(df, by = j)[j]
                for k in d:
                    if pd.isnull(k)==False:
                        try: part[k]
                        except: part[k] = i; i+=1
                code[j] = part
                df[j]=df[j].replace(part)
                del part,i,d,k
        else:
            code = {}
            for j in col: 
                code[j] = reverse(dict(enumerate(df[j].astype("category").cat.categories)))
                df[j]=df[j].replace(code[j])
        if drop == True: df = notobj(df)
        if shape(df)[1]==1: df = df[columns(df)[0]]
        if codes == True: return df,code
        else: return df