Category "python-3.x"

Return the sum of the numbers in the array,except ignore sections of numbers

SUMMER OF '69: Return the sum of the numbers in the array, except ignore sections of numbers starting with a 6 and extending to the next 9 (every 6 will

how to import all the points from a .pcd file into a 2d python array

How do you import all the 3d points from a file named edge_cloud.pcd and put them into an array? I want the array to be in the format array=[[xvalue1,yvalue1,

Why is asyncio session is closed error occurring with my Pymyq script?

I have written a script which uses the Python Pymyq library to interact with Chamberlin smart home devices, in this case a garage door. This script ran success

How to prevent python program crash when receiving alphabetical characters

My code is working just the way I want - unless input contains alphabetical characters. If so, is crashes. How can I prevent that? My code is as follows: def ma

"Help" Command (Defectio.py, similar to discord.py)

I am using revolt.chat which has a similar API to discord.py called defectio. This is the documentation for the default help command https://github.com/Darkflam

fit keras.model from generator_function

TF 2.x - just for the experience I tried with a simple experimental dataset - to show the problem: import numpy as np import tensorflow as tf import keras from

Format Changing Problem of Number Input in streamlit

The program offers the number format as Default in a.b format (like 1.2) but I want to show as a:b format (like 1:2) How can I change this? I tried below but i

Python calculate increment rows till a condition

How to obtain the below result. Sample Data with Output Time To default is the column which is to be calculated. We need to get the increment number as Time to

Pandas Group by index Hour and keeping observation for each hour

I have a pandas dataframe containing one column and a datetime index, i need to group the data by hour and keep each obsevation (record) for each of the grouped

How do I calculate the global efficiency of graph in igraph (python)?

I am trying to calculate the global efficiency of a graph in igraph but I am not sure if I using the module correctly. I think there is a solution that might ma

ParseError: Error tokenizing data. C error: Buffer overflow caught - possible malformed input file. (read_csv)

I cannot use read_csv method of pandas properly on kaggle. Error that I get is: ParseError: Error tokenizing data. C error: Buffer overflow caught - possible ma

Error Setting Python Plugin on Eclipse: Using an Unsupported version (Python and JPython)

I was adding a Python plugin to Eclipse. I was able to successfully add PyDev. However, when I was adding manually the interpreter I got the following error: -

Odoo : How to clear a many2many field when a many2one field change?

Im new to odoo. Im using odoo 13 and I have a many2one field and a many2many field with domain on the many2one field. What I need is that if the user changes th

Getting error Bad File Descriptor while installing pip

whenever i try to install pip i always get this error. pls help . i dont know how to fix this i tried doing it using the default python executable using the mod

Implement constrained optimization problem in Mystic

Is it possible to implement the following problem in mystic? The problem minimizes a sum of squares between two (10000 by 40) matrices: Σ(X-A)^2 where X i

Python program works only from pycharm, not somewhere else

The script works fine when I run it in pycharm, but if I run it from somewhere else it just doesn't work. When I run it via cmd it gives me this error: Tracebac

How to convert input arguments to program as json in python

Here is my code import json import sys def main(): payloads=sys.argv[2] payloads=payloads.replace(",",",\"") payloads=payloads.replace(":","\":")

How to add a word in the list of Alphabetical order in python programming language without repeating letters from the alphabet?

How to add a word in the list of Alphabetical order in python programming language without repeating letters from the alphabet? Here's my code: key=input("Enter

how to apply ModelCheckpoint in a custom training loop for tensorflow 2.0?

we can set tf.keras.callbacks.ModelCheckpoint(), then pass a callbacks argument to fit() method to save the best modelcheckpoint, but how to make the same thing

Unable to exit tkinter app when using "wait_variable()"

I have a python code that includes tkinter window and other running tasks. I've been trying to bind "WM_DELETE_WINDOW" event to a function that exits my python