Questions tagged [python-3.x]
DO NOT USE UNLESS YOUR QUESTION IS FOR PYTHON 3 ONLY. Always use alongside the standard [python] tag.
333,136
questions
0
votes
0
answers
3
views
Comparing columns in a CSV
Let's say I have a CSV invites.csv:
Email Invite Email Denied
batman@email.com ...
0
votes
0
answers
5
views
Normalize Nested JSON structure using Python
Could someone help me getting the nested JSON to normalized JSON objects, I have deep nested JSON structure. I have seen examples using the flatten structure, However having one flatten structure ...
0
votes
1
answer
43
views
Cannot figure out problem with random.randint(x,y)
I'm trying to write a program where you think of a number and the computer tries to guess it by going higher and lower but it refuses to work. I've narrowed the problem down to line 6 or 7 by trimming ...
0
votes
0
answers
5
views
Requests to ngrok are not being forwarded to flask route
I have a flask application running locally on URL: http://127.0.0.1:1234
The app is expecting requests on:
@flask_app.route("/myapp/get", methods=["GET"])
def welcome_b():
...
-4
votes
0
answers
17
views
how to divide a hexadecimal in python?
could someone help me? I would like to divide a hexadecimal but without transforming it to an integer and dividing it.
Hello good afternoon, could someone help me? I would like to divide a hexadecimal ...
0
votes
0
answers
12
views
How to resolve VariantTimeToSystemTime error while reading/converting dates in Python?
def count_messages_in_folder(folder, message_count, sent_dates):
for item in folder.Items:
message_count += 1
try:
sent_date = item.SentOn
if sent_date is ...
0
votes
0
answers
5
views
Exporting Certificates from AWS Certmanager Boto3 Python310
So I manually imported a certificate and key pair issued by a third party to certmanage in AWS and I am trying to programaticly export to a webserver and I get this error:
botocore.errorfactory....
0
votes
0
answers
6
views
optimal predictor value for multivariate regression in Python
Everything I look up on predictions based on multivariate regression shows you how to predict Y, the dependent variable. I found it in R [see link below], but I'm looking for the Python version of how ...
0
votes
0
answers
7
views
Adjusting Alaska and Hawaii location in Base Map for US 50 states Basemap and matplotlib
I have a large dataframe with 5 columns, State, City , Count, latitude, longitude.
I am trying to create a geographical using basemap with 50 US State and cities, in this map the count value need to ...
0
votes
0
answers
8
views
is there any way to install cupy without Cuda
pip install cupy won't install cupy without cuda.
Linux: lubuntu v21.10
pip v3.10
conda v22.11.1
I have linux installed on an older laptop and it doesn't have any dedicated GPU.
I have a python ...
0
votes
0
answers
3
views
Iterating over an API response breaks for only one column in a Pandas dataframe
Problem: In my dataframe, when looping through zip codes in a weather API, I am getting the SAME values for column "desc" where every value is "cloudy" (this is incorrect for some ...
0
votes
0
answers
10
views
joblib: importing .pkl file with personal classes
I'm using Jupyter to learn and practice machine learning. I created a Pipeline object with many classes from Scikit Learn and custom classes that I wrote. After that I saved this Pipeline object in a ...
0
votes
0
answers
4
views
QTextEdit- Change level of one list item without creating new list
I made a custom QTextEdit class and implemented a nesting feature for QTextList.
The bullet list works fine but the numbered list is difficult to realize.
I want to have nested numbered lists look ...
4
votes
0
answers
49
views
Partition of a list of integers into K sublists with equal sum
Similar questions are 1 and 2 but the answers didn't help.
Assume we have a list of integers. We want to find K disjoint subarrays such that they completely cover the given list and all have the same ...
-2
votes
2
answers
27
views
how can make the Periods ring next to scientist (no space)
variable1 = "I"
variable2 = "plan"
variable3= "to"
variable4= "think"
variable5="like"
variable6= "a"
variable7="computer"
...
0
votes
0
answers
13
views
Can I run a Python script targeting only a certain application (screen)?
As I mentioned in the title, I want a feature such as applications that target a certain screen and only target that screen in applications that take more screen recordings or in applications where we ...
0
votes
0
answers
7
views
WebScraping HTTP 403/No Content
I've been trying to learn webscraping and reading information from this website https://parade.com/936820/parade/good-morning-quotes/.
I was able to read in the info a few days ago using:
URL = "...
0
votes
1
answer
39
views
Error, index out of range. What is wrong?
I wrote a Python3 script to solve a picoCTF challenge. I received the encrypted flag which is:
cvpbPGS{c33xno00_1_f33_h_qrnqorrs}
From its pattern, I thought it is encoded using caesar cipher. So I ...
0
votes
0
answers
11
views
Find and replace header/footer text in Word with pywin32
I hope everyone reading this is well. My problem is as follows:
I am trying to find a way to find and replace text in the header (or footer) of a Word document (docx), using the pywin32 library.
Here'...
0
votes
0
answers
9
views
Best tool for visualizing results of test runs and integrating with Jenkins [closed]
I have created a python tool to run tests that use FIX messages and compare the expected and actual FIX responses. I want to integrate this python tool with Jenkins as I want to automate regression ...
0
votes
0
answers
25
views
pathlib relative path issue for upper/parent level directories
I'm facing an issue while trying to get relative path to a parent level directory using pathlib but os.path works. How to satisfy the requirement using pathlib APIs?
In [1]: import os
In [2]: p1 = &...
0
votes
1
answer
8
views
Python - Resolve response Remote URL link with actual page
I am trying to get the actual page URL using the remote URL from JSON response.
Below is the remote URL I get in an JSON API response.
https://somesite.com/mainlink/1eb-68a8-40be-a3-5679e/utilities/...
1
vote
0
answers
29
views
Prevent a regex with capturing groups from acting on matches of a string that re preceded by a specific word and at the same time succeeded by another
import re
input_text = "((PL_ADVB)alrededor ((NOUN)(del auto rojizo, dentro de algo grande y completamente veloz)). Luego dentro del baúl rápidamente abajo de una caja por sobre ello vimos una ...
0
votes
0
answers
13
views
Reading an Audio file (wave format) and decoding .It gives error: "INVALID_ARGUMENT: Header mismatch: Expected RIFF but found caff"
I'm trying to read audio file and decoding it but unfortunately it gives error.
below is the code:
filename = "C:\\Users\\...\\audio.wav"
raw_audio = tf.io.read_file(filename)
waveform = tf....
1
vote
3
answers
52
views
How to change unit of list that was read from a text file?
I'm trying to change the unit of a value in a text file. First part of the task was to turn the string list to a float, but now (without using index()) I want to change the unit of the elemets which ...
-2
votes
1
answer
28
views
I want to create a set of lists that after some input from the user one will be randomly selected
I'm completely new to all this, I have no clue what I'm doing. I just want an easy selector that asks "What genre are you feeling?" then depending on if the input is rock, rap, indie, or ...
0
votes
0
answers
7
views
Faild to restart myapp correctly after compiling in pyinstaller
Hoping you having a good day. Can I ask some help? I'm trying to build a restart code. But, Its not working.
Here is the problem. When I restart the app from source, the restart works fine. But, when ...
0
votes
1
answer
19
views
Python3 itertools permutation & combination question
I want to build a combination of all 7-digit numbers possible from a set of numbers following the rules below.
Each digit can only hold values as shown below from python3 list variables N1-N7 as an ...
0
votes
1
answer
10
views
How to parser soap response in python?
I found some similar solution but it's not working for me. I would like to know the best practice of parser the soap response.
My source code is :
from zeep.transports import Transport
response = ...
-4
votes
0
answers
30
views
I've written a python code where the OpenAI will take prompt input from .text file and return the output
I've written a python code where the OpenAI will take prompt input from .text file and return the output. The max no of tokens where OpenAI can handle is 4000, but my prompt itself is 3989 and it's ...
-3
votes
0
answers
17
views
please help me on this problem i am stuck on this [closed]
Please help me on this problem i am stuck on this.
I has install package using terminal but i don't know what this type of error show showing
please help me on this problem i am stuck on this.
[...
0
votes
0
answers
29
views
How do I filter the results of an API call in Python? [closed]
Here's the API response:
{
"type": "FeatureCollection",
"query": ["10", "downing", "street", "london"],
"features&...
-2
votes
1
answer
15
views
I need to match the unique value of rows from one dataset to the columns matching in another dataset and provide the dataframe
Below is the dataframe example where id is the index
df:
id
A
B
C
1
False
False
NA
2
True
False
NA
3
False
True
True
df2:
A
B
C
D
True
False
NA
True
False
True
False
False
False
True
True
...
-1
votes
1
answer
48
views
A program to print "Hiss" If the input string contains two consecutive occurrences of the letter "s" and "no hiss" , if it doesn't
We need to write a piece of code to print "Hiss", If the input string contains two consecutive occurrences of the letter s and print "No hiss" if it doesn't. What I've written so ...
0
votes
0
answers
7
views
Adding relative path as aa variable
I want to get user input path and use it as a variable. But still struggle to use it right way. I put root variable for error_log creation in the folder by User input.
root = input("Enter path ...
-1
votes
0
answers
19
views
Choosing the video quality by using selenium in Trovo
I'm having a problem selecting a quality resolution from a video on Trovo
Please help me switch to 480P. Can't find the info. Thanks
from selenium.common import NoSuchElementException
import time
from ...
-1
votes
3
answers
46
views
Operation on each possible pair of items in the list
I want to collect the values of the product of each pair in a list of numbers.
This works fine with smaller numbers, but not with larger ones. How can I optimize my solution?
#will work fine with min =...
-2
votes
0
answers
19
views
Map one json's value and create another json
I have source json which consist some value and the motto is to create target json with the value from source json. Below we have source and target json.
Source json:
{
"writers": [
{
...
0
votes
2
answers
30
views
Can not manage to call child methods in a strategy pattern
I am stuck on a strategy pattern implementation.
I would like the child classes methods implementing the strategy pattern to be called, but it seems that it is only the abstract class method that is ...
0
votes
2
answers
45
views
How to find largest among 3 numbers only using 2 if else in python
to find the largest number among the input three number using python the given constraint is some blank space, can anyone help me
the program:
A,B,C=[int(val) for val in input().split()]
print(______ ...
0
votes
1
answer
16
views
Sequence with no __iter__?
Is there any built-in type in Python 3 which implements __getitem__ but does not implement the __iter__ method?
I think in Python 2 the str type was this case but now in Python 3, str type has an ...
0
votes
2
answers
18
views
when i update/edit data is duplicated instead of being updated in django
data is duplicated instead of being updated in django, please help me to overcome this i also tried update method but issues i have faced is image not displayed, therefore i is used save method which ...
-2
votes
1
answer
17
views
Requesting raising "JSONDecodeError: Extra data"
I'm trying to get data from this API:
Documentation: https://api3.geo.admin.ch/services/sdiservices.html#profile
request URL: https://api3.geo.admin.ch/rest/services/profile.csv
There was a prior ...
0
votes
2
answers
45
views
Use driver.find_element("id","") can not find
I want to click button
<p class="btn" id="LargeNextBtn" style=""><a href="javascript:fnNextStep('P');" id="LargeNextBtnLink" onfocus="...
0
votes
0
answers
10
views
python script for 4x4 keypad, some buttons not workin
I'm trying to use a python script to make a connection with my 4x4 keypad on Rastberry (RPi.GPIO).
The code does not work correctly, because the first and second rows does not respond. I'm trying to ...
0
votes
2
answers
33
views
Python | traverse every element from a list in another for loop
Want to traverse each element from below list one by one in next for loops.
How should i do it? how can i fit in one more for loop in it.
currently i am calling accessing summaryList[1] only one ...
0
votes
0
answers
9
views
sklearn v1.2.1: ValueError: custom transformer class
I have installed in my system scikit-learn 1.2.1 and I would like to create custom transformers classes to use with a ColumnTransformer instance. But the problem is when I set the output as pandas ...
0
votes
0
answers
12
views
AttributeError: type object 'PhotoImage' has no attribute 'configure'
I am creating a log in form in python using PYCHARM.I am trying to define a function that will allow me to click the eye icon to hide or unhide the password as it is typed. When the eye button is ...
0
votes
0
answers
19
views
Model always outputs the same confidence score
I have a CNN that predicts lung disease in x-ray images. the problem is when I use my model to predict new images, the classes are predicted correctly but I always get the same confidence score.
This ...
-1
votes
3
answers
37
views
Python: Want to have something taken out of a list how do I do this in python 3?
Here is my code if that helps you answer the question
import random
Exlist = ['pl1', 'pl2']
Exvar = random.choice(Exlist)
print(Exvar)
Exlist = Exlist - list(Exvar)
I tried changing Exvar to a list