I am trying to write something similar to a CASE STATEMENT for Python, so my aim is to check whether the column is a list, and when True it should explode that column.
Static Version:
docs = json.loads(docs)
docs = json_normalize(docs).explode("values")
Dynamic Version (How I started it, but then couldn't figure out how to finish it, or if it's even the right way to do it ):
x = (docs.applymap(type) == list).all()
for i in x:
np.where(i == True,......)
Any guidance or tips will be greatly appreciated.