This file contains hidden or 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 argparse | |
import ast | |
import pandas as pd | |
from datetime import datetime | |
from distutils.util import strtobool | |
from typing import Dict, List, Union | |
def convert_to_dict_list(string: str) -> Union[List[Dict], None]: |
This file contains hidden or 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 math | |
import sys | |
import ijson | |
import csv | |
import argparse | |
def extract_to_csv(json_filename, new_json_filename, csv_filename): | |
# ijson's parser chokes on NaNs, so let's get rid of them | |
# NaN containing fields not needed for Adam's analysis? | |
# if Circularity and Pixel area are NaN, we're in trouble!!! |
This file contains hidden or 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
// Create subcontract info | |
// handling null fields from http://stackoverflow.com/questions/37081842/cant-merge-with-null-values-cannot-merge-node-using-null-property-value-in-n | |
USING PERIODIC COMMIT 100 | |
LOAD CSV WITH HEADERS FROM "file:///subaward3.csv" AS row | |
MERGE (p:Primary {name: row.prime_awardee_parent_contractor_name, awardeeParentContractorName: row.prime_awardee_parent_contractor_name}) | |
ON CREATE SET p.awardeeParentDUNS = row.prime_awardee_parent_duns | |
ON MATCH SET p.awardeeParentDUNS = row.prime_awardee_parent_duns | |
ON CREATE SET p.awardPrincipalNAICSCode = row.prime_award_principal_naics_code | |
ON MATCH SET p.awardPrincipalNAICSCode = row.prime_award_principal_naics_code | |
MERGE (s:Subaward {name: row.subawardee_name, DUNS: row.subawardee_dunsnumber, amount: row.subaward_amount}) |
NewerOlder