def picture(self, row):
        """Create a simplified character representation of the data row, which can be pattern matched
        with a regex """

        template = '_Xn'
        types = (type(None), binary_type, int)

        def guess_type(v):

            try:
                v = text_type(v).strip()
            except ValueError:
                v = binary_type(v).strip()
                #v = v.decode('ascii', 'replace').strip()

            if not bool(v):
                return type(None)

            for t in (float, int, binary_type, text_type):
                try:
                    return type(t(v))
                except:
                    pass

        def p(e):
            tm = t = None

            try:
                t = guess_type(e)
                tm = self.type_map.get(t, t)
                return template[types.index(tm)]
            except ValueError as e:
                raise ValueError("Type '{}'/'{}' not in the types list: {} ({})".format(t, tm, types, e))

        return ''.join(p(e) for e in row)
Create a simplified character representation of the data row, which can be pattern matched
        with a regex