Created
January 28, 2016 11:29
-
-
Save aandr/5402294ba1fd46a18c79 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import pandas | |
import numpy as np | |
from collections import defaultdict | |
data = pandas.read_csv("/Users/alek/Downloads/agenti3.csv", skiprows=1) | |
blanks = [None, '', ' ', 'Неустановена приналежност', 'Неустановена принедлежност', 'Няма данни', 'Неустановане принадлежност', 'Неустановена пренадлежност', 'Нустановена принадлежност', 'Неустанована принадлежност', 'Неустановена принадлежност'] | |
data['is_agent'] = data['Установена принадлежност'].map(lambda x: x not in blanks) | |
print("Number of checked persons", len(data)) | |
data = data[data['is_agent'] == True] | |
print("Numebr of agents", len(data)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment