Vcd

How to download Variants of Concern Data, using python

Pretty Easy, once you can link it. No saving files necessary

#variants #gisaid #python

import pandas as pd

import plotly.express as px

variants=pd.read_csv(‘https://github.com/owid/covid-19-data/blob/master/public/data/variants/covid-variants.csv?raw=true’,parse_dates = [‘date’])

variants[variants[‘location’]==”Hungary”].tail(50)

omi = variants[variants[‘variant’]==’Omicron’]

mix = variants.groupby([‘date’,’variant’])[‘perc_sequences’].mean().reset_index()

varp=  variants.groupby([‘location’,’variant’])[[‘date’, ‘perc_sequences’]].last().reset_index()

varp= varp.query(‘perc_sequences > 0’) #greater than size

varp[‘date’] = varp[‘date’].dt.strftime(‘%m/%d/%Y’)

fig = px.bar( varp, x= ‘location’, y=’perc_sequences’, color=’variant’, hover_data= [‘variant’,’date’], height=900)

fig.update_layout(legend_traceorder=”normal”,template=’plotly_dark’,legend=dict(

        itemclick=”toggleothers”,

        itemdoubleclick=”toggle”,itemsizing=’trace’),hoverlabel=dict(

        bgcolor=”red”,

        font_size=30,

        font_family=”Rockwell”

    )   )

fig.show()

Ralph Turchiano

By Ralph Turchiano

I have a strong affinity for the sciences which led me to create my sites. My compulsion for the past decade has been reviewing literally every peer-reviewed research article. Which can easily be validated by following my posts. To me, science is where the real news is, as it will mold our destiny beyond that of politics or economics. ;-)

Leave a Reply

Discover more from CLINICALNEWS.ORG

Subscribe now to keep reading and get access to the full archive.

Continue reading