Repeat data by group per year

I have a data frame with more than thousand rows like this. org year country a 2010 US a 2012 UK b 2014 Mexico b 2014 CHile b 2015 Brazil And I would like to make my data like this. I want my data to be repeated after appearing. org year country a 2010 US… Read More Repeat data by group per year

How to groupby multiple columns in pandas based on name?

I want to create a new dataframe with columns calculated as means of columns with similar names from this dataframe: B6_i B6_ii B6_iii … BXD80_i BXD80_ii BXD81_i data … Cd38 0.598864 -0.225322 0.306926 … -0.312190 0.281429 0.424752 Trim21 1.947399 2.920681 2.805861 … 1.469634 2.103585 0.827487 Kpnb1 -0.458240 -0.417507 -0.441522 … -0.314313 -0.153509 -0.095863 Six1 1.055255… Read More How to groupby multiple columns in pandas based on name?

Expandable Importrange

I am combining several spreadsheets with identical layouts into one master, and want to create a way to have my query({importrange}) be dynamic, as I will be adding / removing some sheets as time goes on. I have all of my sheet addresses in column C, so my formula right now looks like: =QUERY({Importrange(C4,Sheet1!C5:F);Importrange(C5,Sheet1!C5:F);…} This… Read More Expandable Importrange

Variables within a function

Writing a function to calculate date based on relativedelta. How do I make the ‘frequency’ a variable? e,g, relativedelta(years=5), ability to define frequency: "years", "months", "days" etc.. Tried f-string literal but i think the apostrophe is giving issues. def date_ago(date, period, frequency): """date: "yyyy-mm-dd" frequency: "years", "months", "weeks", "days" period: interger """ date_ago = datetime.strptime(date,… Read More Variables within a function

BottomSheetScaffold is overriding the background color of its parent

I’m trying out BottomSheetScaffold and I just found a strange behavior (maybe a bug) when using it. I put it inside a Box { } that has a cyan background color: composable(route = "my_route") { Box( modifier = Modifier .fillMaxSize() .background(color = Color.Cyan), ) { val coroutineScope = rememberCoroutineScope() val bottomSheetScaffoldState = rememberBottomSheetScaffoldState() BottomSheetScaffold( scaffoldState… Read More BottomSheetScaffold is overriding the background color of its parent