pycatflow/input.py
def detect_dtype(data, prefix):
    """
    Transforms objects inside data into the correct datatypes and returns a sorted and duplicate-free list.

    Parameters:
    data (list): a single column
    prefix (str): delete an unwanted prefix out of the data

    Returns:
    (list): original data without duplicates in correct datatypes
    """
    t1 = []
    t2 = []
    for x in data:
        x = x.replace(prefix, "")
        try:
            t1.append(int(x))
            t2.append("int")            
        except ValueError:
            try:
                t1.append(float(x))
                t2.append("float")
            except ValueError:
                from dateutil.parser import parse, ParserError
                try:
                    t1.append(parse(x))
                    t2.append("date")
                except ParserError:
                    t1.append(x)
                    t2.append("string")
                    continue
    t = []
    for k in set(t2):
        [t.append(data[t1.index(h)]) for h in sorted([x for x, y in zip(t1, t2) if y == k]) if h not in t]
    return t

    Transforms objects inside data into the correct datatypes and returns a sorted and duplicate-free list.

    Parameters:
    data (list): a single column
    prefix (str): delete an unwanted prefix out of the data

    Returns:
    (list): original data without duplicates in correct datatypes
    
Transforms objects inside data into the correct datatypes and returns a sorted and duplicate-free list.
Parameters:
data (list): a single column
prefix (str): delete an unwanted prefix out of the data

original data without duplicates in correct datatypes
Transforms objects inside data into the correct datatypes and returns a sorted and duplicate - free list . Parameters : data ( list ) : a single column prefix ( str ) : delete an unwanted prefix out of the data original data without duplicates in correct datatypes
def detect_dtype(data, prefix):
    t1 = []
    t2 = []
    for x in data:
        x = x.replace(prefix, "")
        try:
            t1.append(int(x))
            t2.append("int")            
        except ValueError:
            try:
                t1.append(float(x))
                t2.append("float")
            except ValueError:
                from dateutil.parser import parse, ParserError
                try:
                    t1.append(parse(x))
                    t2.append("date")
                except ParserError:
                    t1.append(x)
                    t2.append("string")
                    continue
    t = []
    for k in set(t2):
        [t.append(data[t1.index(h)]) for h in sorted([x for x, y in zip(t1, t2) if y == k]) if h not in t]
    return t
def detect_dtype ( data , prefix ) : t1 = [ ] t2 = [ ] for x in data : x = x . replace ( prefix , "" ) try : t1 . append ( int ( x ) ) t2 . append ( "int" ) except ValueError : try : t1 . append ( float ( x ) ) t2 . append ( "float" ) except ValueError : from dateutil . parser import parse , ParserError try : t1 . append ( parse ( x ) ) t2 . append ( "date" ) except ParserError : t1 . append ( x ) t2 . append ( "string" ) continue t = [ ] for k in set ( t2 ) : [ t . append ( data [ t1 . index ( h ) ] ) for h in sorted ( [ x for x , y in zip ( t1 , t2 ) if y == k ] ) if h not in t ] return t
Transforms objects inside data into the correct datatypes and returns a sorted and duplicate-free list.
Transforms objects inside data into the correct datatypes and returns a sorted and duplicate - free list .
"""
    Transforms objects inside data into the correct datatypes and returns a sorted and duplicate-free list.

    Parameters:
    data (list): a single column
    prefix (str): delete an unwanted prefix out of the data

    Returns:
    (list): original data without duplicates in correct datatypes
    """
data
prefix