Skip to main content
The 2024 Developer Survey results are live! See the results

All Questions

Tagged with
1 vote
0 answers
45 views

Cannot get this elif function logic to work for word-game solver, might need suggestions on better method overall

This is the latest functional attempt at doing entry validation for a Solver app (w/ a customtkinter GUI). It seems straight forward, and with a set defining the absolute values of what characters can ...
nannerpuss's user avatar
0 votes
2 answers
61 views

While loop won't end

I have a while loop that calls on three functions. The three functions work as intended and at the end it asks for a user input. If the user input is 'n' the loop is supposed to end, but it continues ...
Broskis's user avatar
  • 19
0 votes
1 answer
70 views

"Preprocessing" a Python function, to avoid excess evaluation of conditional logic

I am writing some Python code that includes functions with two sets of parameters. The first set of parameters will be different every single time the function is called. The second set of parameters ...
Jack MacArthur's user avatar
1 vote
2 answers
65 views

How can I create a function in python that takes an object, modifies the location of it and other objects using CustomTkinter?

I am creating an app that lets you choose exercises and basically what I've been trying to do is create a function that takes the ".grid" element and for the exercise chosen and moves the ...
2185358's user avatar
  • 11
1 vote
3 answers
113 views

What does '[' after an argument in a call function signify in Python?

I have been going through the opencv wiki when I came across the resize function defined as: dst = resize( src, dsize[, dst[, fx[, fy[, interpolation]]]] ) I am unable to understand what the [ after ...
Anjishnu's user avatar
2 votes
1 answer
88 views

How to remove specific parts of text from string?

I am using Python. I have a dataframe with string "description". In these strings, I have things like: "п. 5.6.2 ГОСТ 2.114-2016", "п. 4.1 ГОСТ 2.102-2013", "п.5 ...
user24958090's user avatar
0 votes
0 answers
14 views

Returning a subset of a nested dictionary - Returns None [duplicate]

I'm trying to create a function that take a nested dictionary and returns a subset/item depending on the path provided as an ordered tuple. I'm using a circular reference of the function to iterate ...
Felix's user avatar
  • 1
0 votes
1 answer
55 views

Python flask function isn't being called

So I'm new to flask and am trying to make a library website with flask and mongoDB but everytime I search for the books and try to click on the result for more information about the book it doesn't ...
AVD's user avatar
  • 1
2 votes
0 answers
31 views

Use a list ouput of a Python function as input of another function [duplicate]

I use the follwing Python code: a, b, c = foo() res = foo2(a, b, c) I would like to write instead: res = foo2(foo()) but it doesn't work: the output of foo is regarded as the first argument of foo2. ...
Zlotz's user avatar
  • 187
-2 votes
1 answer
45 views

When I tried to count the string of translated language (tamil) in Python, it didn't give me the correct count why?

code I tried to count the string for the name 'KUMAR' with length function, output came 5 it is correct. But when I tried to count the same name in a different language(Tamil) the output I expected ...
Manoj's user avatar
  • 1
1 vote
1 answer
81 views

How to group rows in dataframe based on timestamps ranges and mean group size maximization?

I have a data frame: prod_id timestamp1 timestamp2 1 2023-12-02 2023-12-01 2 2023-12-05 ...
french_fries's user avatar
2 votes
1 answer
47 views

How to group rows in dataset by two timestamps rage sizes?

I have a dataframe with two timestamps: timestamp1 timestamp2 2022-02-18 2023-01-02 2022-02-19 2023-01-04 2022-02-21 2023-01-11 2022-03-11 ...
french_fries's user avatar
1 vote
1 answer
2k views

Streamlit button on_click how to use it?

I've the following code def drawBtn(): option= ... st.button("Find", on_click= onSearch, args= [option]) def onSearch(opt): # do something and then... st.success("...
Cristian De Vecchi's user avatar
0 votes
2 answers
51 views

Run a class function with a string input [duplicate]

I am converting a program from one database (SQL Lite) to Mongo DB: so I have tons of functions that im trying to simplify. How do I run a class function with the text input? Example def getListData(...
Coenraad Prinsloo's user avatar
0 votes
1 answer
62 views

Creating a function to replace NaN value by traversing up hierarchy columns

I have 2 separate dataframes, data1 and df_attr.Where for df1, there is hierarchy data, where df1.manager_01_email is at the top of the hierarchy while df1.manager_04_email represents the lowest ...
wjie08's user avatar
  • 445

15 30 50 per page
1
2 3 4 5
241