Skip to content
Advertisement

Tag: pandas

How to resize x axis

I want to resize the x-axis range, but I don’t know how to do that. The range I want to resize is [under 20, under 40, under 60, under 80]. X represent age and Y represent survived rate Answer Put your data into age groups before plotting: If you want more polished labels:

how to get last 10 business days if

I want to create dataframe based on last 10 business days. Also it should check whether the day is public holiday or not. I have a list of public holiday. List of public holiday is: Holiday 2021-01-26 2021-03-11 2021-03-29 2021-04-02 2021-04-14 2021-04-21 2021-05-13 2021-07-21 2021-08-19 2021-09-10 2021-10-15 2021-11-04 2021-11-05 2021-11-19 weekends saturday and sunday. so i run the code today,

Plotting graph from data frame

Plotting the graph for both South Asia and Eastern Asia using the above function is showing the same countries and same graphs .What mistake am I doing while writing the above code, I can’t figure that out? enter image description here Answer The problem is with your function. Remove the for loop and it should work

Removing one source value when there are multiple sources

I have the following dataset: I wanna reorganize the dataset in the following way: In word, in each year, for each category if we have value from multiple source (A,B), we will drop the source value of B. But if there is only source value of B, then we will keep that. I have tried to fix it using df.groupby().count().replace(‘count’)

Advertisement