Category "list"

Converting a dictionary of dictionaries to a List of dictionaries

I have a dictionary of dictionaries.Is there any possible way to convert it to a list of dictionaries? And if not, then how is the filter() method applied to fi

Combinations divided into rows with no repetition of elements

I'm working with lists in Python. I have a list of colleagues which is colleagues=['Jack', 'Jessica' 'John', 'Mark', 'Mary', 'Paul'] I want to calculate all po

How do I compare two letters or values in two different lists?

I am making a program that has two lists (in Python), and each list contains 5 different letters. How do I make it so that any index number I choose for both li

Pandas - Add a new column extracting value from arrays based on other column value

I am currently stuck trying to extract a value from a list/array depending on values of a dataframe. Imagine i have this array. This array i can manually create

Pandas - Add a new column extracting value from arrays based on other column value

I am currently stuck trying to extract a value from a list/array depending on values of a dataframe. Imagine i have this array. This array i can manually create

How to merge multiple Maps having the same keys but different values into a single Map

I have n maps of the kind: HashMap<String,Double> map1; HashMap<String,Double> map2; ... What could I do to merge all these maps into a single map?

Multi-level list to data frame in R

I'd like to convert the below list to a data frame but I'm failing at doing it. The list is taken from Microsoft Azure's API listing all resource types with tec

(Python)element at the equal interval from the end

How to get [1,4,7] from the my_list [1,2,3,4,5,6,7,8,9], which is the list of elements at the equal interval(in this case, 3) "from the end" of the my_list? m

SwiftUI: Sheet cannot show correct values in first time

I found strange behavior in SwiftUI. The sheet shows empty text when I tap a list column first time. It seems correct after second time. Would you help me? impo

Finding items in a list along with their price in Python

Python code to find items Price_list = ["01", "Banana", 5.00, "unit", "02", "Mango", 20.00, "kg", "03", "Apple", 15.00, "kg", "04", "Papaya", 25.

Netlogo: update a list after each movement

I need help with the following problem. I have turtles located in 3 different zones A, B, C. They have some properties turtle-own[place-to-go] patch-own[n-of-em

Pythonic way to print list items

I would like to know if there is a better way to print all objects in a Python list than this : myList = [Person("Foo"), Person("Bar")] print("\n".join(map(str

How to generate pseudo-random number in dart

I'm currently trying to pick up a random item in a list in dart. For this, I would like to generate a pseudo-random number (my seed) which will be the index whe

Zipping nested lists

I am trying but am unable to zip the following two lists in a particular way: list1 = [(1,2,3),(4,5,6),(7,8,9)] list2 = [10,11,12] zippedlist = [(1,2,3,10),(4,5

Pull down to refresh data in SwiftUI

i have used simple listing of data using List. I would like to add pull down to refresh functionality but i am not sure which is the best possible approach. Pu

Integer out of range when inserting large number of rows to postgress

I have tried multiple solutions and way around to solve this issue, probably something is still I am missing. I want to insert a list of values to my database.

How to sort a list of lists with IP subnets python

I am a complete noob and have google made my first python script. I am opening a 2 files and removing list 1 from list2. Once list2 has been modified to remo

Xamarin binding sometimes invisible

Inside my Xamarin TicketPage.xaml the binding just shows after a change of the bindingname to notesBlobbed. So i need to change the binding name to notesBlobbed

How do I send list of dictionary as Body parameter in FastAPI?

In FastAPI to pass a list of dictionary, generally we will define a pydantic schema and will mention as: param: List[schema_model] The issue I am facing is tha

Removing all instances of the second string from the first

The question states: Write code that takes two strings from the user, and returns what is left over if all instances of the second string is removed from the fi