Jan-03-2021, 08:26 AM
Hi @allen04,
It's worth if you can mention the exact error or problem you faced with your code.
May be following snippets help you.
It's worth if you can mention the exact error or problem you faced with your code.
May be following snippets help you.
1 2 3 4 5 6 7 8 9 10 |
import pandas as pd # Load the datasets df1 = pd.DataFrame(data = { "Fruit" :[ 'Apple' , 'Orange' , 'Avocado ' , 'Cherry' , 'Cherry' , 'Apple' , 'Banana' , 'Banana' , 'Orange' ], 'Rate' :[ 4.7 , 4.6 , 4.7 , 4.7 , 4.8 , 4.4 , 4.7 , 4.7 , 4.7 ]}) # Set the Fruit column as index df1.set_index( 'Fruit' , inplace = True ) # create a plot (a line chart) df1.plot(kind = 'line' ) |