Issue
I'm using tabula-py to extract some data in JSON format and it is returning:
[{'extraction_method': 'stream', 'top': 580.635, 'left': 699.435, 'width': 49.5, 'height': 15.8399658203125, 'right': 748.935, 'bottom': 596.475, 'data': [[{'top': 586.55, 'left': 701.77, 'width': 33.569969177246094, 'height': 4.809999942779541, 'text': '1,227.57'}]]}]
I'm trying to get the data.text
attribute which I'm struggling to get to. I've tried variations of:
consignment_balance[0]['data']
Looking for a hand as I'm not familiar with Python syntax.
Solution
Read the value from the JSON
bit tricky here.
consignment_balance[0]['data'][0][0]['text']
# '1,227.57'
It has a nested list and dictionary so you need to access it accordingly.
Answered By - Rahul K P
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.