I am working with a panda data frame object. Till now I have uploaded and processed a data frame which looks like below:
The next step is I have to plot a graph with this data frame which will look like this
I have came across a R code snippet which will be helpfull in creating x-axis and y-axis for this graph
d_ends <-
yearly_top %>%
group_by(tag) %>%
slice(n()) %>%
pull(fraction)
d_ends[1] <- 0.053
d_ends[6] <- 0.024
d_labels <-
yearly_top %>%
group_by(tag) %>%
slice(n()) %>%
pull(tag)
I am trying to convert this in Python. Any idea would really be great
Take a look at seaborns lineplot . It's a great package for this kind of plotting:
import seaborn as sns
sns.lineplot(data=yearly_top, x='year', y='fraction', hue='tag')
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.