Skip to content

Instantly share code, notes, and snippets.

@Dexus
Last active August 29, 2015 14:03
Show Gist options
  • Save Dexus/3a40b764f5243cc6afd6 to your computer and use it in GitHub Desktop.
Save Dexus/3a40b764f5243cc6afd6 to your computer and use it in GitHub Desktop.
error json
import json
data = json.loads('[{"p_product":"ECON 101","p_qty":101,"p_tax":"19%","p_eprice":"123,99 \u20ac","p_gprice":"12.522,99 \u20ac"},{"p_product":"ECON 101","p_qty":101,"p_tax":"19%","p_eprice":"123,99 \u20ac","p_gprice":"12.522,99 \u20ac"},{"p_product":"ECON 101","p_qty":101,"p_tax":"19%","p_eprice":"123,99 \u20ac","p_gprice":"12.522,99 \u20ac"},{"p_product":"ECON 101","p_qty":101,"p_tax":"19%","p_eprice":"123,99 \u20ac","p_gprice":"12.522,99 \u20ac"}]')
document.merge_rows('p_product',**data)
# results in:
#
# document.merge_rows('p_product',**data)
#TypeError: merge_rows() argument after ** must be a mapping, not list
#
document.merge_rows('class_code',
[{'class_code': 'ECON101', 'class_name': 'Economics 101', 'class_grade': 'A'},
{'class_code': 'ECONADV', 'class_name': 'Economics Advanced', 'class_grade': 'B'},
{'class_code': 'OPRES', 'class_name': 'Operations Research', 'class_grade': 'A'}])
# dies funktioniert!
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment