Tips: More Readable Data with pretty-print
code
python
beginner
tips
Here’s a tool that some may find useful when working with data that’s not yet in a [DataFrame]
. It lets one “pretty-print” an object making any text that would wrap easier to read.
# [In]
print(results_dictionary)
print("\n --------------------------------------------- \n")
import pprint
=4).pprint(results_dictionary)
pprint.PrettyPrinter(indent# [Out]
'active': True, 'additionalInfo:programDbId': '343', 'additionalInfo:programName': 'UC Davis', 'commonCropName': 'Cassava', 'contacts': None, 'culturalPractices': None, 'dataLinks': [],
{# ...
'trialDbId': '343', 'trialName': 'UC Davis'}
---------------------------------------------
'active': True,
{ 'additionalInfo:programDbId': '343', 'additionalInfo:programName': 'UC Davis', 'commonCropName': 'Cassava', 'contacts': None, 'culturalPractices': None, 'dataLinks': [], # ... 'trialDbId': '343', 'trialName': 'UC Davis'}