Were rewarding the question askers & reputations are being recalculated! Read more.

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
9 views

In tensorflow 2, Is there a way to access the validation data predictions?

I am trying to access the validation data predictions of my model after using model.fit(). I know that I can access the losses using tensorboard callback, but I want to be able to access the data and ...
0
votes
1answer
18 views

Is there an Python Function from which we can audit all the website opened in a “.txt” file while closing the browser?

I am trying to log all the websites I have opened in a text file while closing the browsers using Python. Are there any python methods to get the URL from the browser? I am using "webbrowser" package.
-2
votes
0answers
62 views

Extract strings inside inconsistent nested brackets

I have seen multiple examples of extracting strings from nested brackets. But none of them has shown how to extract strings within nested brackets that are on a new line i.e. \n. For example, I have ...
0
votes
0answers
17 views

Import package in Python3 from different folder without hacking sys.path

I have a directory structure like this - . __init__.py common_modules __init__.py config __init__.py apiConfig.py services __init__.py ...
1
vote
1answer
25 views

keyboard.record() append to list

I'm trying to record all key-presses until i press space and then comparing the key-presses to a list. I cant seem to find a way to save the recorded keys in a list. And yes I need to use space key ...
1
vote
0answers
24 views

Matplotlib : colored text in LaTeX

How to color LaTeX text in matplotlib? import matplotlib.pyplot as plt plt.rcParams['text.latex.preamble']=[r"\usepackage{lmodern}"] plt.rcParams['text.latex.preamble']=[r"\usepackage{bm}"] params = {...
-1
votes
0answers
28 views

I keep getting NotImplementedError error when starting django server

Below is a full trace of the error. Please let me know what could fix this issue: (env) C:\Users\LENOVO\Desktop\SD\backend>python manage.py runserver Watching for file changes with ...
2
votes
3answers
25 views

Dict comprehension from split str

I'm trying to make a dict out this str: a='ALLELEID=677660;CLNDISDB=MedGen:C0162671,OMIM:540000,Orphanet:ORPHA550,SNOMED_CT:39925003;CLNDN=Juvenile_myopathy,_encephalopathy,...
-7
votes
0answers
25 views

Print the following pattern in python: [on hold]

Pattern for N = 5 1 2 3 4 5 11 12 13 14 15 21 22 23 24 25 16 17 18 19 20 6 7 8 9 10 Input format : N (Total no. of rows) Output format : Pattern in N lines ...
0
votes
0answers
6 views

dataset.batched() throws ValueError: Value tf.Tensor(9, shape=(), dtype=int32) has insufficient rank for batching

trying to do this tutorial on windows 8.1 throws: ValueError: Value tf.Tensor(9, shape=(), dtype=int32) has insufficient rank for batching. removing the for loop works fine. from __future__ import ...
0
votes
1answer
14 views

find function in Beautifulsoup return None

I am trying to fetch and track price for a product from Amazon but I get None as find function result!. Here is my code. What's my mistake and what am I missing? import requests from bs4 import ...
1
vote
0answers
24 views

Python3 Django issues regarding paths and custom decorators

Rather new to Django first time using it. Python is not my strong point in a web context - I'm having issues with my custom decorator I made that will decode the jwt from all requests not really sure ...
0
votes
0answers
18 views

OOP to stimulate Book and Bookstore class

Im trying to simulate a bookstore using python with using a book class and a bookstore class. How do i relate the 2 classes and how do I make so that the book class will be automatically added to the ...
1
vote
4answers
44 views

In Numpy, how to combine multiples of the same indices?

I am trying to concatenate the values if they have the same indices. I am working with rectangular shape so I know: There will always at least 2 of the same indices. If there are more than 2 indices, ...
0
votes
0answers
13 views

holoviews dataset select no dimension with illegal python variable characters

I have a holoviews dataset where the name of one of the key dimensions have a space and parenthesis in it. How can I do the equivalent of ds.select(dimension_name=dimension_value) for this dimension? ...
-2
votes
0answers
14 views

Why np.arange(3)[:,np.newaxis] of array shape is not (3,1)?

import numpy as np a= np.arange(3)[:,np.newaxis] print(a)#output a is 1X3 array print(a.shape)#I considered a array shape is a 1X3 array ,but result a array shape is a 3x1 array
0
votes
0answers
17 views

Issue while recording data and uploading to FTP

I am trying to record real time data and upload it to FTP server. My script works, and the first few days there were changes. The first few days of real time data showed time intervals of 00:10:00, ...
0
votes
0answers
7 views

Are there alternatives for pyjs supporting Python 3?

I need a framework like GWT for Python 3. It seems like pyjs does not support Python 3. Are there alternatives for pyjs supporting Python 3?
0
votes
0answers
15 views

Need Some Advice on my Actor Critic Stock Agent

I have tweaked an Actor Critic network I found online that learns to trade stock options based on past stock price data and a couple of technical indicators that get added to the dataframe before ...
0
votes
1answer
21 views

Discord.py syntax error from passing 3 arguments

I'm currently working on a small discord bot and I received the following error: async def redeemkey(ctx, *, member, *, key): ^ Syntax Error: invalid syntax here'...
0
votes
0answers
20 views

How can I install chromedriver in AWS Cloud9?

environment aws ec2 ec2-user:~ $ which python alias python='python36' /usr/bin/python36 ec2-user:~ $ pip install chromedriver Requirement already satisfied: chromedriver in ./.local/lib/...
0
votes
1answer
18 views

create list of bucket indexes based on length of pandas dataframe

I have a pandas dataframe with say 100 rows. I want to create a list of indexes based on N value. For example: If N value is given as 10, then I want to create 10 bucket list somewhat like below: ...
-1
votes
0answers
10 views

what is the method and attribute in python module

I am a beginner for programming. My question may be a stupid question.can anyone answer my questions.. what is the method in python module? method= name,function is this right? and what is the ...
-1
votes
0answers
8 views

DLL load failed can't find window provider with pillow ignored

I'm new to python so i thought i could give kivy a try but i stumbled across this problem. I tried to look online for answers but can't find any that fits the problem and the kivy FAQ listed many ...
-1
votes
0answers
16 views

How to add all number in tuples in python?

How to add all numbers in TUPLES using python? I created sqlite3 table name: SALES REAL, I wanted to add it all inside of the table name SALES. Help please.
-1
votes
2answers
25 views

Python Even/odd values in a list [on hold]

I'm trying to write a program in python that looks at the user input numbers in a list and if they are all even it will print "all even" or "all odd" if they are all odd numbers, if it's a mix of even ...
0
votes
0answers
8 views

Upload PIL objects to S3 via python3 & Boto

I have a dictionary containing PIL Image object + name similar to: {'name': 1, 'page_image': <PIL.Image.Image image mode=RGB size=2387x2560 at 0x7F93FABE10D0>} How would I go going about ...
0
votes
0answers
19 views

Why does tk.Text not destroy properly sometimes?

I am creating a quiz maker, and I have radiobuttons for selecting the question type: multiple select single select short answer I want the choices textbox to show up only if it is multiple select or ...
0
votes
2answers
47 views

For loop in my __init__ doesn't work as expected

class DictionnaireOrdonne: """Classe permettant de crer un dictionnaire ordonn comme une liste, avec des indices""" def __init__(self, **keys_values): """classe prennent ...
0
votes
0answers
6 views

lstrip_blocks in Jinja2 doesn't seem to have an effect?

I am using Jinja2 2.10.3, on Python 3.7. I am trying to determine what exactly the functionality of trim_blocks is... It seems that if lstrip_blocks is set to False, then trim_blocks does nothing. ...
0
votes
0answers
21 views

Python Program ran out of memory [duplicate]

I am trying to make a prefetcher and I have a input list of 108029478 line when I try to open and read it. It is showing me memory error. Can anyone help me to solve it. here is my some code of input ...
0
votes
0answers
13 views

Python 3.7- Input only takes integer, no matter how basic the code

7 and I can't seem to get input to work for anything other than numbers x = input("Hello" ) Just this gives me an error if i input anything other than a number, even floats work but if i put a ...
0
votes
2answers
21 views

How to use 2 methods of filling NA in 1 column in Python

I have a data frame with 1 column. - There are many NA values at the beginning and at the end that I would like to eliminate them completely. - At the same time, there are some NA values in the ...
0
votes
0answers
13 views

Python Kivy app Play Console deployment Problem

I can't pass these warnings. Is there anyone who can help? This APK causes unused code and resources to be sent to the user. If you use the Android App Bundle function, your app may be smaller. ...
0
votes
0answers
10 views

Python Play Video As Desktop Background

I am trying to find a way to set a video as my desktop background, and possibly in the future some kind of image stream from a web url. I was thinking that I would try and do this with Python just ...
0
votes
0answers
12 views

error installing pip requirements error code 1

so i'm trying to install a list of requirements in anaconda on windows 7 x64, i have Python 3.8. and when I try to run it, i get the following, what can I do to fix this? I've tried to re-install ...
0
votes
0answers
19 views

How to remove blank window after using withdraw() tkinter

Whenever I withdraw my root, it will keep a blank window open until after the timer ends. When I deiconify(), it replaces the blank window with the original one I had. The top will open as intended to ...
2
votes
0answers
25 views

How to cancel the call to the input () method in cmd

I have the following problem. In a client system, when a client sends a message, it is attached to a queue to answer messages one by one. Now if the client that is being serviced disconnects you ...
0
votes
0answers
5 views

How can I perform a box cox transformation on a regression model in Python?

How do you perform a box cox transformation on a regression model in Python? I am using these imports from sklearn.linear_model import LinearRegression from sklearn import linear_model import ...
-2
votes
1answer
13 views

NameError: Variable not defined

Please, below is my code to plot a dataframe. The DataFrame to plot On the image above is the picture of the dataframe to plot. Below is the code: fig = plt.figure(figsize = (16,8)) ax = fig....
-1
votes
2answers
35 views

AttributeError: type object 'Node' has no attribute 'value'

class Node(): def __init__(self, value): self.value = value self.prev = None self.next = None class LinkedList(): def __init__(self): self.head = None ...
0
votes
0answers
8 views

Use Dill to serialize function and dependent libraries

Is there a way to dill.dump a whole library? For example say I am trying to serialize the following function: def test(): return np.float(1) + np.float(2) I would like the serialized version ...
-1
votes
0answers
9 views

Some date in index of the data frame are missing when plotting. So i need help to include them too

scored.plot(figsize = (12,6), color = ['green','red']) plt.xticks(rotation=45)The x-axis denotes the index but some dates such as 14-02 and 19-02 is missing when i plot
1
vote
0answers
26 views

Dataframe recursively trace the values until one column is zero

Am trying to analyze a legacy menu system and trace the path of the menu options. The menu system has main menu and followed by sub menu. I am trying to get the details from bottom to top.Here is ...
0
votes
1answer
20 views

What is the difference between threading function and normal function. Does it differ in memory allocation or execution?

Assume I have a function Handle client def Handle_Client(): print('Hello StackOverFlow user') one way to call function handel client using threads Client_Thread=Thread(target=Handle_Client,...
0
votes
0answers
8 views

Python socket server lags while receiving data

I'm prototyping the server side for an app thats supposed to simulate mouse input from an ios device to a pc over wifi. My app uses socket with TCP_NODELAY option set and sends packets " MSM number ...
0
votes
0answers
17 views

Set-Cookie option in flask adds duplicate cookies because of AWS Lambda or Zappa

I am developing an API using Flask and running this API on AWS Lambda using Zappa. I am setting 6 cookies by using the option "set_cookie" in flask. It looks something like this: resp.set_cookie("1",...
-1
votes
0answers
8 views

How do i improve this code to loop through all the 7 pages , i need to get the name, address, website and phone contact for the business listed

This code only gets details from the first page and prints them 20 times import pandas as pd from bs4 import BeautifulSoup, Tag import urllib.request user_agent = 'Mozilla/5.0 (...
0
votes
1answer
34 views

call random values for drawing shapes and removing shapes

My program uses Turtle to draw shapes. It shows the following menu: Enter Circle Enter Rectangle Remove Shape Draw Shapes Exit If the user enters "4", the program should draw the shapes in the ...
0
votes
1answer
18 views

Build scipy objective function dynamically

What I am trying to accomplish: Trying to use the scipy optimize minimize feature and build the lambda objective function dynamically. So I want 1 function to build and return a lambda and I want it ...