Category "python-3.x"

Python 3.6+: Nested multiprocessing managers cause FileNotFoundError

So I'm trying to use multiprocessing Manager on a dict of dicts, this was my initial try: from multiprocessing import Process, Manager def task(stat): tes

How to convert a nested dict, to a pandas dataframe

I'm trying to convert a dataframe that has inside other dataframe like: { 'id': 3241234, 'data': { 'name':'carol', 'lastname': 'netfli

Initializing a variable with INT_MIN in Python 3.8 [duplicate]

About the code The maximum sum subarray problem is the task of finding a contiguous subarray with the largest sum, within a given one-dimensio

Fastest way in numpy to get distance of product of n pairs in array

I have N number of points, for example: A = [2, 3] B = [3, 4] C = [3, 3] . . . And they're in an array like so: arr = np.array([[2, 3], [3, 4], [3, 3]]) I nee

Create a dataclass with field names automatically generated from dict keys

I want to create a dataclass from a dict not only with the values of the dict but also with it's keys automatically recognized as field names for the dataclass.

How do I resolve "No module named 'frontend'" error message?

I have installed PymuPDF/fitz because am trying to extract images from PDF files. However, upon running the code below, I am seeing No module named 'frontend'.

assertion failed: [Condition x == y did not hold element-wise:]

I have built a BiLSTM model with an attention layer for sentence classification task but I am getting an error that my assertion has failed due to mismatch in n

3D point cloud matching

I have a 3D point cloud and I would like to match different point clouds with each other for recognition purposes. Does OpenCV or Tensorflow do it for me? if ye

Flask and flask-restplus dependency conflicts using Werkzeug

I am writing an API using Flask, flask-restplus, Werkzeug, and a few other irrelevant libraries. Here is the issue: flask-restplus is not compatible with the ne

Shopify Inventory Not Update via Shopify GraphiQL App

I have checked the Shopify GraphQL API, and I have tried to update the product inventory on Shopify but when I execute the graphql API it says " Inventory quan

Tkinter Treeview background tag not working

Trying to colorize different rows in a Tkinter Treeview. I have gone through multiple docs and tutorials and believe I am doing it correctly (even tried variati

enforcement for abstract properties in python3

I have this abstract class class Kuku(ABC): def __init__(self): self.a = 4 @property @abstractmethod def kaka(self): pass

Incremental learning in keras

I am looking for a keras equivalent of scikit-learn's partial_fit : https://scikit-learn.org/0.15/modules/scaling_strategies.html#incremental-learning for incre

How do I set or freeze time in python?

I want to set a fixed time using python different than that seen locally on my system , so that when I used datetime.date.today() I get to see the desired date

Django: How to enforce UniqueConstraint with parent and child models

Say I have the following models: class ParentModel(models.Model): parent_field_1 = models.CharField(max_length=10) parent_field_2 = models.CharField(max

pip failed to install dbus-python

I planed to install dbus-python: $ pip --version; python --version pip 19.0.3 from /home/me/anaconda3/lib/python3.7/site-packages/pip (python 3.7) Python 3.7

Problem when importing statsmodels.regression.rolling (AttributeError: 'pandas._libs.properties.CachedProperty' object has no attribute 'func')

When I run the below code: from statsmodels.regression import rolling I get this error message: AttributeError Traceback (most recen

when running tests in django and PostgreSQL DB can't create database

I'm having a problem with running unit tests in django while using ElephantSQL, when running command python manage.py runserver everything works just fine, I'm

Unzipping an archive with zipfile turns an exe into text file (MacOS)

I'm using zipfile (Python 3.6) on a Mac to unzip a zip archive containing files, folders, and an executable. The executable was made with PyInstaller and zipped

Django - How do i check whether a date has expired inside filter condition

How do i check whether a date has expired or not with respect to today in filter condition. eg: task = Task.objects.filter(job=obj, status__in = ["in-progress"