Skip to content

Instantly share code, notes, and snippets.

@sbiyyala
Last active February 3, 2018 00:19
Show Gist options
  • Save sbiyyala/a37f62f27d98a4edc3ac2dfed34c77c9 to your computer and use it in GitHub Desktop.
Save sbiyyala/a37f62f27d98a4edc3ac2dfed34c77c9 to your computer and use it in GitHub Desktop.
Extract attendees for a meetup (new UI's csv download)
#!/usr/bin/env python
# -*- coding: latin-1 -*-
import sys, numpy as np
import codecs
'''
numpy is a pre-req,
$ pip install numpy
$ ./extract_attendees.py > final_attendees.(txt|csv)
'''
def main(argv):
filecp = codecs.open('attendees.csv', encoding = 'cp1252')
name_nd_array = np.loadtxt(filecp, dtype=str, delimiter=',', skiprows=1, usecols=(0, 9))
print '\n'.join([x[1] if x[1] != '' else x[0] for x in name_nd_array])
if __name__ == '__main__':
exit(main(sys.argv))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment