How do I convert a CSV table like this:
|url |skin |paws|
|https://demo.foo/cats |Fur |YES |
|https://demo.foo/dogs |Fur |YES |
|https://demo.foo/fish |Scales |NO |
into an inline DataFrame, like this?
df = {'url': 'https://demo.foo/cats', 'https://demo.foo/dogs', 'https://demo.foo/fish'],
'skin': ['Fur', 'Fur','Scales'],
'paws' ['YES','YES','NO']}
I have tried pd.read_csv(foo).to_dict(orient='records')
and to_list
, but none of them output the format above.
I've been searching for three hours for an answer. I think this is such a dumb question, that I don't think anyone has ever asked it.