Im trying to figure out how to make a graph with these modifications :
Create the following visualization (i.e. scatterplot) that shows the relationship between the total vaccinations (x axis) and people fully vaccinated (y axis) for the states of California, Colorado, and Texas.
I don’t know how to single out the three states from the rest.
I tried this
cal = df[df[ 'location' ] = = 'California' ]
cool = df[df[ 'location' ] = = 'Colorado' ]
tx = df[df[ 'location' ] = = 'Texas' ],
but my code will not work.
It’s a csv file with all the states from
USA COVID-19 Vaccinations | Kaggle
I just started with bokeh, jyputer and thonny this week, so all of this is very new to me.
This is my attempt.
Create the following visualization (i.e. scatterplot) that shows the relationship between the total vaccinations (x axis) and people fully vaccinated (y axis) for the states of California, Colorado, and Texas.
I don’t know how to single out the three states from the rest.
I tried this
cal = df[df[ 'location' ] = = 'California' ]
cool = df[df[ 'location' ] = = 'Colorado' ]
tx = df[df[ 'location' ] = = 'Texas' ],
but my code will not work.
It’s a csv file with all the states from
USA COVID-19 Vaccinations | Kaggle
I just started with bokeh, jyputer and thonny this week, so all of this is very new to me.
This is my attempt.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 |
import bokeh import pandas as pd from bokeh.plotting import figure from bokeh.io import output_notebook, show output_notebook() df = pd.read_csv ( 'us.csv' ) print (df) # not working df['total_vaccinations']= pd.to_daytime(df['total_vaccinations']) #total_vaccinations x red bold #people_fully_vaccinated y black #filter data #location #California red #Colorado green #Texas blue # (3) Include a ‘grey’ border around the visualization with line width of 8 and alpha value of 0.8 cal = df[df[ 'location' ] = = 'California' ] cool = df[df[ 'location' ] = = 'Colorado' ] tx = df[df[ 'location' ] = = 'Texas' ] |
Larz60+ write Jul-28-2022, 07:46 PM:
Please post all code, output and errors (it it's entirety) between their respective tags. Refer to BBCode help topic on how to post. Use the "Preview Post" button to make sure the code is presented as you expect before hitting the "Post Reply/Thread" button.
Fixed for you this time. Please use bbcode tags on future posts.
Please post all code, output and errors (it it's entirety) between their respective tags. Refer to BBCode help topic on how to post. Use the "Preview Post" button to make sure the code is presented as you expect before hitting the "Post Reply/Thread" button.
Fixed for you this time. Please use bbcode tags on future posts.