Category "list"

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

Google foobar minion labor shifts challenge

I have a Google foobar challenge: Write a function called answer(data, n) that takes in a list of less than 100 integers and a number n, and returns that same

How to find the maximum number of a list within a dictionary? [closed]

I was given a dictionary of lists and I must find the maximum number of each list. Then I must print the number of days in a month (in each li

How do I split certain element within a list to create another list in python?

I have a list below: list = [' ab: 1', ' cd: 0', ' ef: 2 gh: 3', ' ik: 4'] From above list, I need something like below: newlist = [' ab: 1', ' cd: 0', ' ef: 2

attributeError: 'list' object has no attribute.....

I am getting attributeError, but I don't understand.... class User(): def __init__(self, first, last, age): self.first = first self.last

how to assign an entire list to each row of a pandas dataframe

I have a dataframe and a list df = pd.DataFrame({'A':[1,2,3], 'B':[4,5,6]}) mylist= [10,20,30,40,50] I would like to have a list as element in each row of a

Convert numpy array from space separated to comma separated in python

This is data in .csv format file generally we expect array/ list with [1,2,3,4] comma separated values which it seems that nothing happened in this case data =

How to search for a string in a list of lists?

I have a list of lists like the below: pb_file = [ ['n012345_y','n012345_e','n023561234_u','n012345_p','n012345_k'] ['n124536_i','n1542453_m','n10978_k

How to break a list in multiple columns with Bootstrap 4?

With Bootstrap 4, how can I have something like this: [ 1 ] [ 4 ] [ 2 ] [ 5 ] [ 3 ] [ 6 ] In other words, how to break a list into two equal columns, orderin

Cache-friendliness std::list vs std::vector

With CPU caches becoming better and better std::vector usually outperforms std::list even when it comes to testing the strengths of a std::list. For this reason

Inconsistent Accessibility in Lists c#

I'm following an RPG c# tutorial, and have come across this error. It is not explained in the tutorial, and I'm unsure what i did wrong. Here is the class: usin

Fastest way to remove duplicates in a list without importing libraries and using sets

I was trying to remove duplicates from a list using the following code: a = [1,2,3,4,2,6,1,1,5,2] res = [] [res.append(i) for i in a if i not in res] But I wou

How Do I Return a Different Value When Iterating Over a List of Lists

ISSUE I have a FOR loop that creates a list of lists where each entry consists of the input and associated output. I can't figure out how to iterate over the o

How to print two lists of different size side by side?

I have two lists of different length that I want to print side by side, separated by a tab. As an example: a_list = ["a","b","c","d","e"] b_list = ["f","g","h"

What is the purpose of [marks for name, marks in marksheet]

Here is the code marksheet = [] for _ in range(0,int(input())): marksheet.append([input(), float(input())]) second_highest = sorted(list(set([marks for