Questions tagged [python-3.x]

USE ONLY IF YOUR QUESTION IS VERSION-SPECIFIC. For questions about Python programming that are specific to version 3+ of the language. Use the more generic [python] tag on all Python questions. Use the [python-2.x] tags for Python 2 questions.

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

Importing AST modification

I'm attempting dynamic rewrite of pywin32 win32com.client module prior to import, the below seems to work - but I'm not happy with the 6 lines of code for importing (after the last comment). Can ...
user avatar
0votes
0answers
9views

How to write UnitTest for a websocket notification class in python?

I am not sure how i can mock the websocket.serve method and other methods of websocket module, Need help in creating a unittest for this class. if anyone help in creating unittest for these methods? ...
user avatar
0votes
0answers
4views

How to construct the Bode plot of an FIR filter when coefficients are badly conditioned?

I'm trying to plot the Bode plot of an FIR filter which is used to reject unwanted frequencies over 100 Hz with a sampling frequency of 500kHz. The filter has many coefficients in order to produce as ...
user avatar
0votes
0answers
6views

conversion of string to a statsmodels.tsa.arima.model.ARIMAResultsWrapper class type

I have a dictionary which values are lists (of lists of strings). Some of these strings are names, used as variables for statistical models (ARIMA-- a time-series model). There is a variable name for ...
user avatar
-1votes
0answers
13views

Python's Bluetooth library of the Bleak report "bleak.exc.BleakError: Could not get GATT services: Unreachable" , how to solve it?

I'm a rookie, I've been doing nothing for a few days and have to turn to overflow for help (┬┬﹏┬┬) Windows 10 downloads a python third-party library of the bleak package and conda's virtual ...
user avatar
-1votes
0answers
10views

Ragged nested array need to be converted to array of float

I have a ragged nested array with class 'numpy.ndarray' which I want to convert it to a string of float which I already try to use np.asfarray to change it. the problem is that, my Jupyter Notebook ...
user avatar
-1votes
0answers
13views

Store Debit/Credit cards data(Benefits) offered

I'm looking for APIs which can help me get the data for the cards(Any kind of cards are fine) offered by particular banks in India. I have tried going through multiple site but I have found all the ...
user avatar
0votes
0answers
5views

Selenium using python and configuration problem

I have installed Pycharm community edition and configured the interpreter successfully which includes selenium also. Wen I am trying to write selenium code like calling webdriver . It is not ...
user avatar
-3votes
0answers
18views

How do i start another python script(pygame) and when the game window is open go back to the program but the game should still work

This code starts my game inside of my voice assistant: elif Answer1.lower() == 'game5': import snake snake How do I start the game window, let the game work but go ...
user avatar
0votes
3answers
33views

How would you convert the following dictionary to a specific JSON structure?

I'm by far not a Python3 hero, but focussed on learning some new skills with it, thus any help would be appreciated. Working on a personal project that I want to throw on GitHub later on, I run into ...
user avatar
-6votes
0answers
21views

Difference between spectral and pseudo-spectral method while writing python code [closed]

What are the differences between spectral and pseudo-spectral (method) in Python code? Kindly, show good examples of codes where I can understand the basic differences between the above two methods.
user avatar
  • 1
0votes
0answers
21views

TypeError: 'dict' object is not callable in BeautifulSoup [closed]

I tried writing code that would get all the titles and links on Google search result, then print all those titles and links. from bs4 import BeautifulSoup import requests import colorama from colorama ...
user avatar
0votes
0answers
15views

What is the exact Tiktok API endpoint to get list of video ids (aweme_ids) using user id (uid)?

TikTok API to fetch the list of video ids corresponding to a particular username I have been getting the USER_ID using /aweme/v1/discover/search/?keyword=USERNAME&cursor=0&count=10&type=1&...
user avatar
0votes
1answer
9views

Can anyone help me create a nested loop with an increment?

What I mean is a nested loop that will print out symbols. The number of symbols should be determined by incrementing the rows. At the same time the column of symbols should run for a set number before ...
user avatar
  • 11
0votes
0answers
8views

Dash Plotly error TypeError: Object of type DataFrame is not JSON serializable

Hello I am working with Dash for making dashboard. Below is my code. I tried to fix the error but not able to fix, Can anyone look into this? on chrome i am getting. Error loading layout I am getting ...
user avatar
  • 23
0votes
0answers
11views

I want my code to wait unless either of two buttons is pressed

ui.py import tkinter as tk sc = 0 q_txt = 'Can you please verify the pythagorous theorem using similarities of triangle.' class Window(): var = tk.IntVar() def __init__(self): self....
user avatar
0votes
1answer
21views

How to fix this IndetationError in python?

from timeit import Timer timer_obj1 = Timer('list_sum()'), 'from_main_import list_sum' timer_obj2 = Timer('numpy_arr_sum()'), 'from_main_import numpy_arr_sum' print('Pure ...
user avatar
0votes
0answers
27views

how to convert nested dictionary into table using python for loop?

I have a nested dictionary which look like this: m = {'match':{'football':{'cricket':'batball','player':'joe','match':36}}} and I want to convert this dictionary into table using for loop without ...
user avatar
  • 23
0votes
0answers
10views

Ragged Nested Numpy Array to Tensor

I have ragged nested arrays of .npy file that I have processed. The error is that it my model failed to convert the NumPy array to a Tensor with the remark 'Unsupported object type list') I have try ...
user avatar
-2votes
1answer
20views

Python newb "Fill in the empty function so that it returns the sum of all the divisors of a number, without including it."

Good Day I'm a Python newb and I'm having a hard time figuring out how'd the output ended up 55? Also what is this sum in return sum? Are there any other methods also to make it less complicated? def ...
user avatar
  • 1
0votes
0answers
7views

How to crate a Hybrid Work Model roster simulation

My office is currently manually creating Hybrid work model Rosters. Can we automate the process in Python/Pandas? Rules for creating a roster is: for 2 weeks (10 working days) people should be in ...
user avatar
-1votes
0answers
12views

Please help: My PyInstaller exe is not opening

I have this program which I can use to update a program. The problem is when I convert the program to .exe from .py using pyinstaller(using --onefile and --noconsole commands too) it is not opening. ...
user avatar
  • 1
-1votes
0answers
17views

Difference in precision when using Decimal constructor [duplicate]

I am learning Python and read about Decimal. Then i noticed the difference in output of the following two statements: >>> Decimal('0.1') + Decimal('0.10') + Decimal('0.10') - Decimal('0.30') ...
user avatar
  • 128
0votes
1answer
41views

Pandas get rows with subtracting rows as a index

I have a function in python that gets the two rows for a yfinance dataframe of tickers. I am doing a calculation, where I make a row that holds the value obtained from subtracting the value, then ...
user avatar
  • 415
0votes
0answers
15views

Getting RuntimeError in Python while submitting in UVa Online Judge

I tried to solve problem 101 on Online Judge but Online Judge is giving me a RuntimeError. However, it runs just fine on my computer. This is my code: total_blocks = int(input()) inp = '' commands = []...
user avatar
0votes
0answers
4views

In mask detection open cv code and then when i press esc the window open says not responding and also tuple is not callable error is shown

This is my code: import cv2 from tensorflow.keras.models import load_model from keras.preprocessing.image import load_img,img_to_array import numpy as np import PIL model=load_model('saved_model.h5') ...
user avatar
-4votes
1answer
22views

CREATE A FUNCTION TO SORT(ASC) AN ARRAY BY THE QUANTITY OF THE ALPHABET 'A' IN IT [closed]

CREATE A FUNCTION TO SORT(ASC) AN ARRAY BY THE QUANTITY OF THE ALPHABET 'A' IN IT EXAMPLE : ['APPLE','BANANA','PLUM'] HAS 1,3,0 'A' IN IT RESPECTIVELY SO THE SORTING WOULD BE ['PLUM','APPLE','BANANA']
user avatar
0votes
0answers
8views

How to create two different table in same model?

I want to create two different table in one model, I had change the table name but my 2rd table insert data in the first table, can someone tell how to do? import datetime from peewee import ...
user avatar
  • 680
1vote
2answers
15views

the ways of using zip function to generate the cell location based on the row and column information

I created the following dataframe, and would like to identify the cells which are Null, import pandas as pd import numpy as np data = [{'a': 1, 'b': 2, 'c':3}, {'a':10, 'b': np.NaN, 'c':"&...
user avatar
  • 4,679
0votes
0answers
34views

Calculating complexity of custom list append function

I have created "C Array" in Python and added implementation for append as below: class Array: def __init__(self, size): array_data_type = ctypes.py_object * size ...
user avatar
  • 11.2k

15 30 50 per page
1
2 3 4 5
10320