python - 'type' object is not subscriptable - Stack Overflow
pd.DataFrame is a method and of type 'type'. So, you are getting error as 'type' object is not subscriptable. So, fru_prices = pd.DataFrame ( [fruits,prices]) Share Improve this answer Follow answered Sep 23, 2018 at 5:24 Jagadeesh Dondeti 344 2 12 But fruits names are in row wise how to make it column wise ? – sk jainmiah Sep 23, 2018 at 5:25