141,969
questions
0
votes
0
answers
8
views
Keep duplicate dictionaries of a list of dictionaries
In my playbook, I have a list of dictionaries. I want to keep only duplicate dictionaries.
Basically it is something like:
{
"l": [
{
"a": "d",
...
1
vote
0
answers
32
views
Python function to remove strings from a list if a substring already exists
I'm wondering if they're is a "pythonic" way of removing elements from a list, if that element contains a substring of another element.
For example say we have a list like this:
["/var/...
0
votes
2
answers
25
views
containsInAnyOrder hamcrest matcher with custom comparator
I have a DTO class
class MyDto {
private String f1;
private String f2;
private String f3;
// constructor
// get set equals/hashCode
}
It has equal/hascode pair which takes into ...
2
votes
1
answer
57
views
Python Polars Zip several columns of type of List
I have two columns of type pl.List(pl.List(str)) that I want to append elementwise with a separator like ;.
Given a dataframe
df = pl.DataFrame({
"A":[["Hi", "my", &...
1
vote
1
answer
24
views
iOS SwiftUI List is not lazy
I read everywhere that List is supposed to be Lazy on iOS but following snippet seems to contradict it
import SwiftUI
struct Item {
var id: Int
}
let items = (1...30000)
.map { v in
...
0
votes
1
answer
56
views
Need help to choose the right data structure in C++ [closed]
In C++ only
I have a list of elements maintained in certain order. The order is dynamically changed and the elements are added/deleted at anytime. I need to add/delete or modify the element position ...
0
votes
1
answer
48
views
Generating a custom list until it hits a predetermined length [duplicate]
I want to generate a list that combines other lists into one with differing repeating patterns until I hit an arbitrary number of items in said list. I have the following in mind:
...
1
vote
2
answers
41
views
how to change the order of inputs in this extension app to make the newest lead at the top instead of the bottom
As you can see if u tried the code and save an input in the app it will be save in a top to bottom order and i want it to be from bottom to top order, here is the whole code and if you want the html ...
-2
votes
1
answer
44
views
Why am I receiving a letter inside the string instead of the string itself? [closed]
#The list "Items" is [at the end of the code: "print(quantity, '*', items[item], 'Added')"] #not giving the item when I enter the items number. Instead it prints a letter inside ...
0
votes
2
answers
80
views
How to remove duplicates and unify values in lists where values are very close to each other in Python?
I have in Python lists like below:
x1 = ['lock-service',
'jenkins-service',
'xyz-reporting-service',
'ansible-service',
'harbor-service',
'version-service',
'jira-service',
'kubernetes-service',...
3
votes
6
answers
110
views
How do I find all combinations of pairs, such that no elements of the combination have a common first or last value?
I have a list of number-letter pairs like:
all_edges_array = [
[1,'a'],[1,'b'],[1,'c'],
[2,'c'],[2,'d'],
[3,'b'],[3,'c']
]
...
-1
votes
1
answer
24
views
Issue reading lists from parquet file into a dataframe showing as None on MacOS but working for Windows
I have a number of parquet files with pricing data, the bid and ask prices and sizes are stored as a list of float values
e.g.
bidprices \
0 [4....
1
vote
3
answers
91
views
How can I convert a list to numerical in r?
I am using the following data and have come across a roadblock.
I used read.csv to import my raw data into r.
# from OHP$ohp17.value
list(NULL, NULL, "19.9 nmol/L", "0.7 nmol/L", ...
0
votes
1
answer
71
views
Length filter for list not working correctly
I am making a binary randomizing program that takes text in randomizes it and then output the randomized binary. But in the part that returns 7 digit binary objects to a list isn't working properly.
...
-3
votes
0
answers
20
views
"int" object is not callable in sum function [duplicate]
I built a program to get the total value of all the items in the inventory.
items_list = [{
"name":"A",
"price":"20",
"quantity":"5"
},
{
&...