BUG: to_json should raise exception for non-unique index / columns (#4359)
Issue #4359

to_json will raise ValueErrors where non-unique indices or columns would cause invalid JSON to be produced. Updated docstring and added some tests.

thanks!

fixing #4377 now
 Why don't `to_dict`  can return a list of values for non Unique indexes being the key in dictionary? Came here from issue #22801.