Consider the following single index DataFrame:
energy fat
1 2000 28
2 1900 17
3 2200 30
4 1750 15
5 1800 18
6 1600 12
I also have a multindex Series:
1 vitamin-c 0.0004
vitamin-a 0.0150
2 vitamin-c 0.0030
3 vitamin-d 1.2000
vitamin-e 1.0007
vitamin-c 1.2020
4 vitamin-a 0.0780
5 vitamin-b 0.9650
6 vitamin-e 1.9801
vitamin-c 1.0011
How can I join the two so the result looks like this:
energy fat vitamins
1 2000 28 vitamin-c 0.0004
vitamin-a 0.0150
2 1900 17 vitamin-c 0.0030
3 2200 30 vitamin-d 1.2000
vitamin-e 1.0007
vitamin-c 1.2020
4 1750 15 vitamin-a 0.0780
5 1800 18 vitamin-b 0.9650
6 1600 12 vitamin-e 1.9801
vitamin-c 1.0011
I tried df.join(series, how = 'inner') but all I got is the following error message:
"ValueError: cannot join with no level specified and no overlapping names"
Can someone please explain me what im doing wrong here and how i can achieve the combination of the two ? Thank you !
Serieswould be very helpful.