Category "list"

How to create a dictionary, where the key is the key of a dictionary of lists and the value is the longest list

I have this dictionary of lists of dictionaries: dict_countries ={'uk': [{'datetime': '1955-10-10 17:00:00', 'city': 'chester'},{'datetime': '1956-09-10 13:00:0

How to find different items between mulitiple lists

I am trying to figure out how to compare n lists to find the different items. For example, consider the list: list_l = [[1,2,3,4,5,100], [1,2,31,41,

C#: Update List Item

public class person { public string name { get; set; } public string family { get; set; } } And I have a list of the same as Below: List<person&

Python valueError: setting an array element with a sequence, TypeError: only size-1 arrays can be converted to Python scalars on MLP

I have this dataset (shape is (36,2)). x is a numerical pattern, y is a binary class (0,1) x y [0.2, 0.3, 0.5 ..... 0.5] 0 [0.1, 0.4, 0.5 ..... 0.9] 1 and so

Add item to SharePoint list

How do I add an item from an Excel file to a SharePoint list? I cannot use Access as an additional step here. Within Excel 2019 I run a macro and part of it sho

How to get forwaard moving combination of a list in python?

I have a following list lst = [100,200,300,400] I need the following output [(100, 200), (200, 300), (300, 400)] I did some research and used itertools.combinat

SwiftUI - List Line Separator Inset like iOS Settings App

I'm trying to achieve the behavior that's also seen in in the iOS Settings App or for instance the Roborock App (see screenshots below). I'd like to go for an I

How to validate list of email in winform C# with specific rules

Mine concern is the following. I have these 2 classes : public class Campaign { public string name { get; set; } public string description {

How to return a position of elements in a list using only positive number?

I created a list for the user to enter a number, which is the position of the elements in the list, but it still work for negative number. Are there anyway to s

function that takes directory of .txt file and returns a dictionary based on set parameters?

I want to make a function that takes the directory of a .txt file as an input and returns a dictionary based on specific parameters. If the .txt file is empty,

How to print strings and integers in the same line?

I'm trying to print each item in the following two lists: lNames = ['John','David','Michael'] lAges = [45,14,32] with the format: "Person 0, Name: John, Age 3

How to loop vertically through a list in Python?

This is my code atm: puzzle = [ ['1','1','1','1','1','1','1','1','1','1'], ['1','0','0','0','0','1','1','1','1','1'], ['1','1','0','1','0','0','0','0','0','0'],

How to insert an element in a list after using del in python

def my_len(lst): mylen = 0 for i in lst: mylen += 1 return mylen def insrt(lst, what, where): length = my_len(lst) tmp = [0] * (len

How could I display all the text of a column in a list?

I am using share point online and there is a news list. The problem of this list is that it shows only few lines of text in the Body column. If I want it to sho

Creating an error message for an invalid input in python

I have been trying to create a program that creates a list from user input. The program is meant to give an error message to the user input when the length of t

DynamoDB: FilterExpression when querying List Type Attribute for "Contains"

I have looked all over the place and I can only find minimal documentation and examples on using FilterExpressions to filter records with a given value containe

extract attributes from list

I am a novice in python and I treat to extract emotions from list and put each attribute to its corresponding series to train machine learning algorithms for ex

Creating a new dataframe column with the number of overlapping words between dataframe and list

I'm having some trouble fixing the following problem: I have a dataframe with tokenised text on every row that looks (something) like the following index feelin

Make a list out of frequencies, concatenating categories to that list

I am trying to adapt this solution, by onyambu: New data dat_in_new <- structure(list(rn = c("Type_A", "Type_B" ), `[0,25) east` = c(1269L, 85L), `[0,25)

How to slice a nested list twice?

With a nested list like: ex_list = [[1, 2, 3], [4, 5, 6], [7, 8, 9]] I need to be able to slice this list for: [[1, 2], [4, 5]] I've been trying: list(ex_list