1,471 questions
3
votes
1
answer
222
views
How to typehint functools.partial classes
I'm struggling to type hint correctly a python dataclass (or any class) with partial initialization, it seems that the type is lost somewhere but not sure where:
from dataclasses import dataclass
from ...
0
votes
0
answers
37
views
Save file in folder using partial folder name [duplicate]
I created a button that is supposed to allow users to save a copy of the current file in a folder. The path changes, depending on the value of A1.
For example, if A1 is 9999, I want the file to be ...
0
votes
0
answers
27
views
Sum of vlookups with a partial match: What is the formula, if it exists?
I'm trying to see if this is even possible. I am essentially trying to get a partial match vlookup with the added component of possibly a sumifs formula to get the total amount of pay for each store.
...
3
votes
1
answer
81
views
How to pickle Enum with values of type functools.partial
Problem
Suppose we have a python Enum where values are of type functools.partial. How to pickle and unpickle a member of that enum ?
import pickle
from enum import Enum
from functools import partial
...
0
votes
1
answer
109
views
Type similar to Record<A, B> but saying that not for every A there is a B value (not even an undefined)
Record is defined as follows:
/**
* Construct a type with a set of properties K of type T
*/
type Record<K extends keyof any, T> = {
[P in K]: T;
};
It is defined such that for a Record&...
3
votes
1
answer
112
views
functools partial with bound first argument and *args and **kwargs interprets calls as multiple values
Using python 3.10:
I have a function with a first argument and then *args and **kwargs. I want to bind the first argument and leave the *args and **kwargs free. If I do this and the bound function ...
0
votes
3
answers
77
views
How to aggregate only parts of members of each group in one query statement in PG?
I have a table people(gid int, name varchar) with data:
gid name
1 Bill
2 Will
2 Musk
2 Jack
1 Martin
1 Jorge
now I want to get a result set like ...
-1
votes
1
answer
61
views
Can you link a partial class to several classes in C#
I'm writing a series of classes that all implement the same interface. While writing them, I've come to realise that they all use the same logic. Given the design of the interfaces, I can't think of a ...
0
votes
3
answers
105
views
Pandas map two dataframe based on column name mentioned on the other df and partial match to derive new column
I have two dataframes df1 & df2 as below.
import pandas as pd
data1 = {'Column1': [1, 2, 3],
'Column2': ['Account', 'Biscut', 'Super'],
'Column3': ['Funny', 'Super', 'Nice']}
df1 =...
1
vote
2
answers
329
views
Finding locator by the first part of the locator value
I have the following line of code that clicks on a locator
await page.locator('#react-select-4-option-0').click();
How can i click the same locator based on only the first part of the code, something ...
0
votes
1
answer
81
views
Return partial View if model state was not valid
I have a slider that has a registration form, I create the form as a partial View .
this is the method of create registration form:
Get method:
public IActionResult CorporationRegisterRequest()...
1
vote
0
answers
49
views
I have a problem in Isabelle related to 'Clash of types' that I am unable to solve. Could someone help me?
I would want to formalise a calculus in Isabelle. I started with this definitions:
type_synonym Signature = "string ⇀ nat"
type_synonym 'a Interpretation = "string ⇀ 'a list set"
...
0
votes
0
answers
87
views
Need Help Implementing Multi-Segment Matching With PCRE2 in C++
I am trying to implement multi-segment matching with pcre2_match in accordance with the documentation.
// #define PCRE2_CODE_UNIT_WIDTH 0
// #include <pcre2.h>
// Variable initialisation
char ...
1
vote
1
answer
96
views
Merge two datasets by partial string - R
I have two datasets both with different columns however both with names. I wanted to match the names and concatenate the rows to each other
df1 <- data.frame (Name = c("Smith, Carl", &...
0
votes
1
answer
90
views
Partial correlation, Non-parametric data
I am struggling to know how to conduct a partial correlation when data is not normally distributed...
I have tried this and it is giving me data (the code has worked), but is this how you would ...
0
votes
3
answers
252
views
How to selectively copy properties from a deep nested data structure?
I would like to copy a object from an existing object.
But I only need the field I want below
Since whiteList approach is required, I couldn't simply copy the whole object and then use a delete ...
1
vote
2
answers
66
views
Python Merge 2 DICT objects if matching id within a list with separators
In Python I have those 2 dicts objects :
dict1 = [{'id_contact': '1', 'name': 'Rick'},{'id_contact': '9', 'name': 'John'}]
dict2 = [{'id_company': ';1;3;4;11;', 'company_name': 'Nike'},{'id_company': ...
0
votes
1
answer
209
views
Rails 7.0.4 Turbostream does not refresh partial outside yield-block
I'm running rails 7.0.4. I use turbostream to refresh a content of the corresponding view without reloading all page. Everything goes well if I refresh content inside <%= yield %> block (nested ...
1
vote
0
answers
11
views
Matching a Partial object does not work when constructing the object using an object literal when using generics in Typescript [duplicate]
When using the following construct Typescript fails to infer the correct type and match it with a partial of the same object. I assume this is not a bug and I am missing something. Can anybody tell me ...
1
vote
2
answers
843
views
The best example to plot a correlation graph with ggplot2
I made a partial correlation analysis, with the ggm package
list = list(mtcars, mtcars)
list = lapply(list, function(x) x %>%
mutate(gear = as.factor(gear)))
library(ggm)
...
0
votes
1
answer
343
views
How to perform partial correlation analysis with a grouping variable on list of datasets
I am using the following reproducible example that might suit my case. If possible, I have been trying to execute a partial correlation analysis between mpg and disp, hp, vs. I am not sure if the ...
0
votes
1
answer
423
views
I am looking to find a partial match between two arrays
I'm trying bring about a partial match result based on two arrays. One array has paragraphs that might contain words from the second array. If there is a match to one of the words in the second ...
0
votes
0
answers
401
views
Excel: Index Match with partial text search into another Worksheet
Attempting to use a Index* + Match* + Match partial* function from one Workbook to another Workbook.
This formula works within the same workbook, but fails once applied over to another Workbook.
...
-1
votes
1
answer
71
views
Excel pulling multiple wild card data from string to define type in other column
Wondering if there is a better way to pull multiple partial texts from a string in one column to define a type for each line item in a separate column.
string examples:
HEAVY HEX BOLT ASME B18.2.1 ...
0
votes
0
answers
17
views
partial doesn`t pass Tkinter argument [duplicate]
I am creating a python application. whenever I print the argument (the content of the entry widget) I get nothing instead of what I entered.
here is my code:
class App(tk.Tk):
def __init__(self):
...
2
votes
2
answers
368
views
How would I use fread() for a partial read, and get my expected output here?
I am having difficulty with using the fread() function to read values from a file for a very specific and unlikely use case. This sounds really stupid, but an assignment I am working on requires me to ...
0
votes
1
answer
354
views
DOORS DXL compare two strings; partial matches
I need to compare two text strings for partial, potentially multiple matches. I've been using the matches dxl function and it works great for simple matches, but is failing for more complex strings.
...
1
vote
1
answer
288
views
Typescript - Restrict values of object keys to some possible values, but don't make them mandatory
I've got some types defined as:
export const ABC= {
A: 'A',
B: 'B',
C: 'C',
} as const;
export const DEF = {
D: 'D',
E: 'E',
F: 'F',
} as const;
export type AbcTypes = (typeof ABC)[keyof ...
0
votes
2
answers
81
views
Node.js - EJS - including a partial : error : Could not find the include file "partials/navbar.ejs" in nodejs app
Could not find the include file "partials/navbar.ejs" in nodejs app
about Node.js - EJS - including a partial
Could not find the include file "partials/navbar.ejs" in nodejs app
...
1
vote
0
answers
264
views
Python pickling SSLContext TypeError when using tqdm
I have a generic method for handling parallelization using p_tqdm (similar to tqdm) and functools.partial to handle multiple input args, like:
from functools import partial
from p_tqdm import p_umap
...
0
votes
2
answers
64
views
How to create a partial type that return an error if too much information are given
I would like to create a type that can accept a partial object but that can also return an error if we give to that object extra properties.
I tried that but it doesn't work like i want.
type Object = ...
1
vote
2
answers
3k
views
(Python) How can I print the function name of a partial function
I am running a process where I add failed functions to a list to be retried later. I use partial for this. Now I want to print what function is being retried.
Example Code:
retry_queue = []
def foo():...
0
votes
1
answer
37
views
Iterate over list of objects, which can be tuples or objects
I have a list of functions that all take a number, do something to it and then return transformed number, some of them accept extra arguments, some not.
def foo(num):
return num + 5
def bar(num, ...
1
vote
0
answers
71
views
Different results in partial correlation with packages ppcor and correlation (method="spearman")
I am running a partial correlation var1, var2 and var3 with pcor (package ppcor) and correlation (package correlation). Both with the spearman method but the results are different. Could someone tell ...
1
vote
1
answer
338
views
Powershell partial string comparison
I'm currently stuck on a specific comparison problem. I have two CSV files which contain application names and I need to compare both csvs for matching names. Of course that would be easy if the ...
1
vote
1
answer
33
views
I want to replace some wrongly assigned elements from the dataframe in python based on the previous elements
Station_ID
ID809086
t
ID809088
ID809089
.
.
ID809098
t
ID809100
.
.
.
Basically I want to replace all 't' with previous ID +1, such as t = ID809087 and ID809099 in above scenario. Thanks in advance
...
1
vote
1
answer
88
views
Rails : Named yield not rendering wit partial
I am trying to render a partial using a named yield. Here's my template
<%= render 'shared/remote_modal', modal_title: "bru" do %>
<%= content_for(:modal_content) do %>
<...
1
vote
1
answer
73
views
Assigning a function with another function as parameter to a variable in Python
Let's say I have the following 2 functions:
def add(*numbers, squared=False):
return (sum(numbers) ** 2) if squared else sum(numbers)
def multiply(*numbers, half=False):
mult = 1
for i in ...
0
votes
2
answers
34
views
C# Razor, repeated Partial pages in a web page use the same data instead of haveing their own data
I have a web page in which I want to display the same partial windrose chart 2 times with 2 different sets of data. However whatever data is returned for the 1st partial page is incorrectly used for ...
0
votes
1
answer
218
views
Specifying word boundaries for multiple string replacement with regex?
I'm trying to mask city names in a list of texts using 'PAddress' tags. To do this, I borrowed thejonny's solution here for how to perform multiple regex substitutions using a dictionary with regex ...
-1
votes
3
answers
1k
views
BeautifulSoup find partial string in section
I am trying to use BeautifulSoup to scrape a particular download URL from a web page, based on a partial text match. There are many links on the page, and it changes frequently. The html I'm scraping ...
0
votes
1
answer
27
views
.htaccess redirect partial query string
I'm trying to redirect the following kind of URL:
https://my_store/product_thumb.php?img=images/my_image_example.jpg&w=120&h=120
to:
https://my_store/images/my_image_example.jpg
I tried the ...
0
votes
1
answer
119
views
Elasticsearch and Searckick: Unable to get partial match on a joined field
I am trying to implement elasticsearch on Rails using Searchkick.
The goal is to search on 5 field of order, 2 of which are joined fields, and ideally partial matches using word_middle
For search_data
...
2
votes
2
answers
170
views
How to pass more than one parameters to render in rails?
Below is my review.html.erb:
<% provide(:title, 'All reviews') %>
<h1>All reviews</h1>
<ol class="reviews">
<%= render @reviews %>
</ol>
<%= ...
0
votes
1
answer
622
views
Moving files into subfolders according to partial filename with VBA
I have been trying to move over 300+ pdf files to subfolders, which partially match filenames. The file names format is as follow:
Definition, PN 123456, SN unique
Definition(may change), PN 657634(...
1
vote
1
answer
699
views
Google Spanner - Java Mutation - Delete rows with subset of composite key values
I have a requirement where I need to delete rows based on the subset of composite keys via mutation.
I have a table
CREATE TABLE FOO
(KEY1 INT64, KEY2 INT64, KEY3 INT64, VALUE STRING(100))
PRIMARY KEY ...
0
votes
1
answer
193
views
VBA / INDEX MATCH - Partial data
my macro takes a long time to proceed and sometimes Excel blocks.
Tab A: list of specific languages in the "Database" tab (column A ).
Tab B: list of some virtual profiles (column D) ...
-1
votes
2
answers
66
views
My partial array keeps adding the empty data C#
I'm new to C# and we need to create an array that can hold 100 scores. But it needs to also accept something smaller (txt file with numbers between 0-100). My issue is that even tho I add a txt file ...
11
votes
1
answer
4k
views
Why do Object.values for a Partial Record have undefined typings?
When extracting Object.values from a Partial Record, the values are a union between what I would expect and undefined.
const example: Partial<Record<string, number>> = {}
const values = ...
1
vote
1
answer
58
views
How do I assign to a variable-specified key of a `Partial<MyInterface>` without an error that it can't be assigned to undefined?
In this TypeScript code, also repeated below, there is a function which builds up a partial object in the application's type system from component parts. However, it doesn't work with the noted error ...