-
-
Save hsyyid/b31bd5702816b79954d55c859c3803df 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
# Specify lookup keys | |
qb_lookup_keys = {'key_prop': 'name', 'value_prop': 'value'} | |
# Explode these into new columns | |
invoices = (invoices.pipe(gs.json_tuple_to_cols, 'Line.SalesItemLineDetail.ItemRef', | |
col_config={'cols': {'key_prop': 'Item', 'value_prop': 'Item Id'}, | |
'look_up': qb_lookup_keys}) | |
.pipe(gs.json_tuple_to_cols, 'Line.SalesItemLineDetail.ItemAccountRef', | |
col_config={'cols': {'key_prop': 'Item Ref', 'value_prop': 'Item Ref Id'}, | |
'look_up': qb_lookup_keys})) | |
invoices[['Id', 'Item', 'Item Id', 'Item Ref', 'Item Ref Id']].head() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment