Questions tagged [python-3.x]

For questions about Python programming that are specific to version 3+ of the language. Use the more generic [python] tag if your question is not version-specific. Use the [python-2.x] tags for Python 2 questions.

Filter by
Sorted by
Tagged with
0
votes
0answers
2 views

Want to play a camera from One raspberry pi to another raspberry pi using python3 via wifi

I want to play a camera from One raspberry pi 3 to another raspberry pi 3 using python 3 languages via wifi. But I have some error come that cannot understand and not solve it also. I have already ...
0
votes
0answers
4 views

What is my problem to use of Conv2D for image?

First I read pictures from folders and sub-folders. Then I’m changing images to gray and resizing to 100*200. I want to classify my images to 6 class. When i want to create my model, I can't use ...
0
votes
0answers
5 views

Python requests not returning all cookies in Flask

I have tried the exact code in terminal which gives the required result which is 10 cookies but when I shift this code to Flask only 2 cookies are returned and I don't understand why because the code ...
-7
votes
0answers
8 views

how to make operating system using python [on hold]

Chinese smartphone maker Xiaomi has recently told about the success of Redmi Note 7. The company has said that 50 lakh units of the Redmi Note 7 series have been sold so far from launch. This series ...
0
votes
0answers
5 views

Unable to import Pandas in AWS Lambda

I am new to AWS Lambda and I want to run code on Lambda for a machine learning API. The functions that I want to run on Lambda are, in summary, one to read some csv files to create a pandas dataFrame ...
-1
votes
0answers
6 views

XML Tag Replacement using Python

I have a xml file as shown on below. Recently started working on Python. I need to replace the ... element to .... I have a coding but it replaces the closing element too. Please advice. XML File: &...
0
votes
4answers
30 views

Counting the most common element in a 2D List in Python

I am looking for a way to count occurency in a 2D List. For example I have a list like that: [[John, 3],[Chris, 3],[Bryan,5],[John,3],[John,7]] As an output I want to count which numbers does John ...
1
vote
1answer
9 views

Is there a way to create multiple dataframes from single dataframe using pandas

I want pandas code to create multiple dataframes from single dataframe using pandas. For example: my main dataframe: col1 col2 col3 HR john 3000 HR tedd 4000 Logistic muller 5000 ...
0
votes
0answers
4 views

I have a drive image. How can I analyse and retrieve or recover all files from that drive image ? Is it possible using Python programmatically?

I was asked to retrieve all image files from hard drive or any USB drive image. How can I do that ? I was asked to do that programmatically . Are there any libraries in Python to analyse disk image ...
0
votes
0answers
6 views

pdftotext is not getting installed in windows

I am trying to extract data from an invoice. I found invoice2data will do that job. I have pip installed invoice2data. from invoice2data import extract_data This is getting imported. result = ...
-2
votes
1answer
39 views

need of maximum value in int

I just started programming in c and i know some basics of python so when i set a very big int value to a variable in python say '58944651132156484651' and print the variable everything will be fine ...
0
votes
1answer
14 views

Constant output of 2D Convolutional regression in Keras-tensorflow

I would like to try to use a 2D Convolutional neural network as a regressor. This is, how I do it, using the mnist dataset, that is available in tensorflow. First, we load the mnist dataset. ...
0
votes
0answers
8 views

Why can't replace placeholder with format function in pymysql?

How i create the table mingyan. CREATE TABLE `mingyan` ( `tag` varchar(10) DEFAULT NULL, `cont` varchar(255) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8; It's said that string format ...
0
votes
0answers
11 views

How to correctly attach an eventFilter with installEventFilter to a QtWidget?

I am writing Python code around a C++ application based on Qt5. My Python code is passed an instance / object of the QMainWindow class - which is implemented in C++. I can neither derive from this ...
0
votes
1answer
13 views

Issue with div`s in Scraping with Python and Beautiful Soup

I'm learning a bit of web scraping and I'm having trouble accessing to the list I want to go address. I tried with: print(container.div.div) None Process finished with exit code 0 print(...
-3
votes
0answers
23 views

What is the preferred way of setting and getting instance variables of class in python 3 [on hold]

I just want to know what is the preferred way of getting and setting instance variables of python 3 class . i am habitual of using dot(.) method of getting and setting the instance variables.... but ...
0
votes
0answers
31 views

how to use combination inside combination

I got a task in python that I need to bring the number of combinations. I have a range of numbers 1-50, I need to bring all the combination available for 10 digits, and in this result I need to find ...
0
votes
0answers
24 views

How to name a pandas data frame with a value contained in a list or a variable?

I'm trying to use the values contained in a list or a variable to name a Pandas DataFrame but can't make it... I have made a list of files I want to import as separate DataFrame than use a value in a ...
-1
votes
0answers
13 views

AttributeError: 'numpy.dtype' object has no attribute 'is_floating'

I develop my own op using eager execution. I met an error. How to fix it? Env: Colaboratory TF ver.: 1.14 I use: mnist = input_data.read_data_sets("/tmp/data/", one_hot=True) I tried tf....
-4
votes
0answers
21 views

Frequent Letters in Python [duplicate]

Given a string, you have to find the first n most frequent characters in it. You have to print the three letters in alphabetically sorted order. The input will contain two lines, the first line will ...
1
vote
2answers
17 views

Can't change instance attribute of my class?

I'm starting out in python and I can't quite figure out why I'm unable to change the data stored in one of my instance attributes. I have the following code: class Bank: def __init__(self, bank = '...
-4
votes
0answers
23 views

[SOLVED]can't find a python code/module that allows me to temporarily stop a process and prevents it from re-opening even manually [on hold]

I want to build a code that kills a process like chrome and prevents it from re-opening(even manually) in a specified period of time such as (example: from 09.00 to 12:30 you wont be able to open ...
0
votes
1answer
18 views

Python Multithreading no current event loop

My Threading works fine only when fetch() is not called from validate(). But in this scenario below it returns RuntimeError: There is no current event loop in thread in all the threads 0 - 99 what ...
-1
votes
1answer
25 views

How to fix two conditions on one statement

I want to connect these two lines with an or statement but it keeps looping infinitely, however it works with only one statement attached. SDepth = input('Enter the depth of either 38 or 48: ') ...
-1
votes
0answers
27 views

Add column to dataframe and merge

I have two dataframes, I need to merge using one to one, I can not use concat or any other method it must be one to one merge. dfa does not have a matching column name to dfb dfa({"CD Number": [1,2,...
-2
votes
1answer
24 views

How to fix ' table Students has no column named student_name'?

I am still new to SQL and databased programming and all... I am having an issue with adding a student's info to my data base adn keep getting the table Students has no column named student_name Error. ...
1
vote
0answers
19 views

Detect if user has clicked the 'maximized' button

I would like to detect if user has clicked the 'maximize' button: In tkInter of course, but I don't know how. I have tried searching through StackOverflow, The Web & tkInter documents(mostly ...
1
vote
0answers
48 views

Multiple Interpreters vs multiprocessing

I'm trying to understand why multiple interpreters should be an advantage against multiprocessing. Multiple interpreters may be introduced in python 3.9 according to PEP 554 (currently draft). For ...
1
vote
0answers
5 views

Connecting to nco_sql in Netcool using Python

Currently I am using shell script to connect nco_sql functionality in Netcool to connect to its SQL interactive interface. Using that we are querying the Object Server taking input from SQL files(...
0
votes
1answer
9 views

Django Rest Framework - Testing client.login doesn't login user, ret anonymous user

Problem So I am testing my drf app, and I am trying to test if my user created at the setUp method was logged in after using self.client.login(**creds) method. For some reason, I am not able to ...
0
votes
1answer
18 views

Divide 2 integers (leetcode 29) - recursion issue

I'm having issues when i need to do a count (or aggregation) in recursion problems, for eg. in this problem where i'm trying to divide 2 integers w/o using multiplication, division and mod operator. ...
0
votes
0answers
13 views

list duplicates in list of dictionary and return those vaues [on hold]

I have a list of dictionary: here if login id is repeated then only that id shoud come out as a output and for that output igg should be appended. i tried with for loop but it is printing out all ...
0
votes
0answers
11 views

Coroutine method to overlap read (dbapi) and process (pandas) operations

I have a task that requires reading a very large database table in chunks, and performing some complex processing (using Pandas) on each chunk. The time to read a chunk from the database is close to ...
-1
votes
0answers
8 views

How can i create a queue and skip function for a music bot in the new version of discord.py (version 1.0 and above)

I am creating this discord bot which allows people to play music. Currently, I have implemented the play, stop and resume functions. Now I want to implement a queue and skip function. However, all ...
0
votes
1answer
25 views

How do I scrape pdf and html from search results without obvious url

I would like to scrape the pdfs and htmls from the search results from this page: http://www.nas.gov.sg/archivesonline/speeches/search-result?search-type=advanced&speaker=Lee%20Kuan%20Yew and ...
-3
votes
1answer
15 views

Is there a way to automatically make a “collage” of plots with matplotlib?

I have a Python script using pandas and matplotlib that outputs 4 plots into individual PNG files. This part is fine. I would also like to make all 4 plots into a collage automatically - nothing fancy,...
0
votes
0answers
5 views

Websocket connection failing when using Nginx + Gunicorn + Flask

I'm attempting to deploy a Flask app with Socket IO to a Linode server (Ubuntu 18.04). I'm using Gunicorn paired with Nginx as well as Supervisor to make sure the Flask app will automatically restart. ...
1
vote
1answer
23 views

Filling in Missing Entries in CSV File Using Pandas

I am programming in Python3 using Sublime Text 3. I have a csv file with 8 columns, two of which are empty. After reading the file using pandas, I am iterating through the rows, taking data from the ...
2
votes
2answers
46 views

Unicode string is working on python2 but not in python3

I wrote a program in which I have some Unicode labels, but strange issue is appearing. The Unicode string is working fine on python2, but not in python3, It works in python3 on my other computer, btw, ...
2
votes
1answer
21 views

Librosa Constant Q Transform (CQT) contains defects at the beginning and ending of the spectrogram

Consider the following code import numpy as np import matplotlib.pyplot as plt from librosa import cqt s = np.linspace(0,1,44100) x = np.sin(2*np.pi*1000*s) fmin=500 cq_lib = cqt(x,sr=44100, fmin=...
0
votes
0answers
11 views

key error for an index key that should no longer exist

I had an original dataframe with an index length of 1440, which i had transposed with pd.transpose and now has an index length of 48. Now when I try to iterate over the rows it throws KeyError: 1440 ...
0
votes
1answer
58 views

Looping through a function

I am struggling with figuring out the best way to loop through a function. The output of this API is a Graph Connection and I am a-little out of my element. I really need to obtain ID's from an api ...
-4
votes
0answers
29 views

I don’t understand how is the .next attribute used in (current.next) without being defined in the function attributes? [on hold]

This a code used to create linked list in Python, My confusion is how is .next used without being defined like (value,head and new_element). class Element(object): def __init__(self, value): ...
1
vote
2answers
39 views

Getting text from <span> tag element

I have a table in which each row has a xpath and within each row a column is embedded. There is a tag in row's xpath that changes text based on what you choose on that page. <div class='...
2
votes
3answers
63 views

I need my script to run several lines until task is completed [duplicate]

I need for the questioning part of the code to occur until the player has guessed the number. I'm a bit of a beginner, and I'm writing a simple code for guessing a number. I've gotten to a point ...
2
votes
2answers
23 views

Indexing 3d numpy array with 2d array

I would like to create a numpy 2d-array based on values in a numpy 3d-array, using another numpy 2d-array to determine which element to use in axis 3. import numpy as np #-----------------------------...
0
votes
0answers
17 views

KeyError When Running Custom Search JSON API

I am using the Custom Search JSON API on Python. I am running this code to test it out: import sys print(sys.version) from googleapiclient.discovery import build import pprint my_api_key = "(my ...
0
votes
1answer
10 views

AttributeError: 'int' object has no attribute 'hideturtle' ??? What does that mean?

There is an error in my code. I do not know how to fix this. It is supposed to create a game that you need to shoot the yellow blocks. Can anyone please help me? This is the whole code. import ...
0
votes
0answers
11 views

Polling Socket Select inside Docker on Windows (via Python/Pyramid)

tl;dr - Example code from Pyramid cookie cutter example does not respond to requests generated from outside the hosting Docker container on Windows. Other code that doesn't rely on non-blocking I/O (...
0
votes
1answer
20 views

find if a semantic version is superset of of another version python

I have a use case where I have a list of Java maven semantic ranges trying to find the list of versions that I can exclude in my application. Example: SemVersion1 = "[,1.8.8.1)" SemVersion2 = "[,1.8....