Skip to content

Instantly share code, notes, and snippets.

@dchaplinsky
Created March 11, 2015 11:46
Show Gist options
  • Select an option

  • Save dchaplinsky/fb4533e7b27b456aabce to your computer and use it in GitHub Desktop.

Select an option

Save dchaplinsky/fb4533e7b27b456aabce to your computer and use it in GitHub Desktop.
In [1]: from unicodecsv import DictReader
In [2]: fp = open("problematic.csv", "r")
In [3]: r = DictReader(fp)
In [4]: r.next() # First row is not interesting
Out[4]:
{u'\u0406\u041f\u041d': u'',
u'\u0414\u0430\u0442\u0430 \u0432\u0456\u0434\u043f\u043e\u0432\u0456\u0434\u0456': u'',
u'\u0414\u0430\u0442\u0430 \u0437\u0432\u0456\u043b\u044c\u043d\u0435\u043d\u043d\u044f': u'',
u'\u0414\u0430\u0442\u0430 \u043d\u0430\u0440\u043e\u0434\u0436\u0435\u043d\u043d\u044f': u'',
u'\u0414\u0430\u0442\u0430 \u043f\u0440\u0438\u0437\u043d\u0430\u0447\u0435\u043d\u043d\u044f': u'',
u'\u0414\u0435\u043a\u043b\u0430\u0440\u0430\u0446\u0456\u044f 2010': u'',
u'\u0414\u0435\u043a\u043b\u0430\u0440\u0430\u0446\u0456\u044f 2011': u'',
u'\u0414\u0435\u043a\u043b\u0430\u0440\u0430\u0446\u0456\u044f 2012': u'',
u'\u0414\u0435\u043a\u043b\u0430\u0440\u0430\u0446\u0456\u044f 2013': u'',
u'\u041a\u0430\u0442\u0435\u0433\u043e\u0440\u0456\u044f': u'\u0421\u0442\u0440\u0430\u0442\u0435\u0433\u0456\u0447\u043d\u0456 \u0434\u0435\u0440\u0436\u0430\u0432\u043d\u0456 \u043f\u0456\u0434\u043f\u0440\u0438\u0454\u043c\u0442\u0441\u0432\u0430',
u'\u041b\u0456\u043d\u043a \u043d\u0430 \u0432\u0456\u0434\u043f\u043e\u0432\u0456\u0434\u044c/\u043b\u0456\u043d\u043a \u043d\u0430 \u0441\u0430\u0439\u0442': u'',
u'\u041d\u0430\u0437\u0432\u0430': u'',
u'\u041f\u0406\u0411': u'',
u'\u041f\u043e\u0441\u0430\u0434\u0430': u''}
In [5]: row = r.next()
In [6]: row[u"Дата народження"]
Out[6]: u''
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment