Skip to content

Commit

Permalink
convert series to list
Browse files Browse the repository at this point in the history
  • Loading branch information
annacprice committed Oct 28, 2021
1 parent fa0fba3 commit c9c62a3
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions covate/build_time_series.py
Original file line number Diff line number Diff line change
Expand Up @@ -163,20 +163,20 @@ def plottopseries(dataframe, lineagelist, regionlist, output, enddate, adm, line
rownum = int(num)
lineageregioncount[lineage] = pd.Categorical(lineageregioncount[lineage], categories=lineagelist)
lineageregioncount.dropna(inplace=True)
toplineagelist = lineageregioncount[lineage].iloc[0:rownum]
toplineagelist = lineageregioncount[lineage].iloc[0:rownum].tolist()

for region in ascendregionlist:

regionframe = dataframe[dataframe[adm].str.match(region)]
regionframe = regionframe.reset_index()

regionframe[lineage] = pd.Categorical(regionframe[lineage], categories=toplineagelist)
regionframe.dropna(inplace=True)

regionframe['combine'] = regionframe['sample_date'].astype(str) + "_" + regionframe[lineage].astype(str)
regionframe['frequency'] = regionframe['combine'].map(regionframe['combine'].value_counts())

regionframe.drop_duplicates(subset=['combine'], inplace=True)
regionframe.dropna(inplace=True)

cc = regionframe['frequency'].to_numpy()
sc = lambda x : scalepoint*x
Expand Down

0 comments on commit c9c62a3

Please sign in to comment.