Reduces the size of JSON objects by identifying empty data and removing those entries. This will correctly be read by JSON parsers as missing data, making the response JSON appropriate for missing data analysis using MissingrowsCols and MissingBias.
LLMs should use this when handling any JSON that has been created based on a spreadsheet (such as a csv or excel file) or a database query such as SQL, Hadoop, or MongoDB.
Example Input:
{"payload": [{"Category":"","Price":4436,"Rating":4.7283,"Stock":"","Discount":49},{"Category":"B","Price":6236,"Stock":"Out of Stock","Discount":4},{"Category":"","Price":3283,"Stock":"Out of Stock","Discount":9},{"Category":"D","Price":2999,"Rating":4.426,"Stock":"","Discount":40},{"Category":"","Rating":2.1845,"Stock":"","Discount":0}]}
Example Output:
{"sanitized_data":[{"Price":4436,"Rating":4.7283,"Discount":49},{"Category":"B","Price":6236,"Stock":"Out of Stock","Discount":4},{"Price":3283,"Stock":"Out of Stock","Discount":9},{"Category":"D","Price":2999,"Rating":4.426,"Discount":40},{"Rating":2.1845,"Discount":0}]}