Quantcast
Channel: Active questions tagged python - Stack Overflow
Browsing all 23247 articles
Browse latest View live

I've some trouble studing python flet. Is it bug or my fault?

Please help me find the reason for this code behaviorThere are 3 identical boxes (flet Container()) with switch (flet Switch()).Only switch in first box "unit_view1" is available for switching. Other...

View Article


Techniques for solving the problem with an unbalanced data set

I am trying to solve a problem with an unbalanced data set. I have two classes, one is for patients with risk 1, the other for patients without risk 0.I have a much larger number of patients without...

View Article


Lock classes and Threading in python for dict moifications

I was learning and testing threading in python, and Lock class, So in here I want to add a key to persons but let's say it will takes some time, in another thread I want to read the key. in first...

View Article

Accessing columns of a numpy ndarray in a vectorized manner

I have a list of lists of indices like so:outer_list = [[0], [1, 2], [1, 2], [3, 5], [4], [3, 5]]Each inner list contains the index number of itself within the outer list.I also have a numpy array with...

View Article

matching numpy conditions row and column without iteration

Given a dataframe condition defined as:0 [3, 4]1 [2]I want another dataframe's 0th row, column 3 and 4 and 1th row, column 2 to be set to 0For example given another dataframe df2: 1 2 3 4 0 0.275464...

View Article


DoesNotExist at /up_emp/31/

DoesNotExist at /up_emp/31/Employee matching query does not exist.Request Method:POSTRequest URL:http://127.0.0.1:8000/up_emp/31/Django Version:5.0.6Exception Type:DoesNotExistException Value:Employee...

View Article

MessageFilter.check_update() telegram

This is the code for the Telegram bot that I'm testing:from typing import Finalfrom telegram import Updatefrom telegram.ext import Application, CommandHandler, MessageHandler, filters,...

View Article

How to make my dictionary thread safe in python?

I have a class as follows, which maintains simple dictionary for historical records. It needs to support insertion of records and lookup, i.e. given ID and year, returns all records older than given...

View Article


Telebot bot.get_chat_member(chat_id, user_id) throws an error

def is_sub(channel_id, user_id): try: chat_member = bot.get_chat_member(chat_id=channel_id, user_id=user_id) return True #return chat_member.status in ['member', 'administrator', 'creator'] except...

View Article


I have a problem, my project is charging station and the problem is the coin...

The pulse is working when I charge my phone and inserts a coin, and now when i want to extend my charging time when I insert a coin for the extend time feature the pulse is not working. The language I...

View Article

Elastic Bean Stalk API's issue

I have my environment running on elastic bean stalk and its deployed successfully also have enabled https on the environment and link is working fine but the issue is:I have my python backend hosted...

View Article

Image may be NSFW.
Clik here to view.

How to completely remove a package from PyPI or TestPyPI?

I could remove all releases of my package example_package_superkai but could not remove the package itself from PyPI or TestPyPI as shown below:Or:Actually, How to remove a package from Pypi doesn't...

View Article

Tokenizers && Docker :Could not build wheels for tokenizers, which is...

I have a project with Python 3.9 using some lib to create chatbot, and actually, until now I couldn't build my Docker image without issues with the tokenizers.The Terminal just showed up this error...

View Article


AttributeError: module 'tensorflow' has no attribute 'map'

dataset.map(preprocess)AttributeErrordataset.map(preprocess)AttributeError: module 'tensorflow' has no attribute 'map'What is the solution?

View Article

Understanding Tkinter window, and Canvas sizes

I can’t get any information on exactly how window and canvas sizes work in Tkinter.If I create a window, I can set its size using either the .configure() method or the .geometry() method. If I set...

View Article


Running Jupiter Lab via Command Line WIndows

I have followed the instruction on the official website of Jupyter.I installed JupyterLab with pip:pip install jupyterlabAnd then I tried to run JupyterLab with:jupyter-labIt says the following...

View Article

Add cells to current jupyter notebook

I want to execute code in a jupyter notebook that appends a cell to the notebook that is executing the code and writes code in it.e.g. in 'test.ipynb' execute code like...

View Article


django login Authentication returns None

I am trying to authenticate in django but when I enter the real credentials it assigns the user as None, but when I enter credentials that do not exist it does not assign it as None.views.pydef...

View Article

How do I defer reflection on a view/table without primary keys?

I have a view xyz.MyTable that I'd like to build a model for. It doesn't have a unique column but the combination of columns col1 and col2 are guaranteed to be unique.I also don't have access to the...

View Article

Python function causes changes to input pandas dataframe

I have a Python function that modifies a pandas dataframe in various ways. This includes dropping a column. Counter to my intuition, this drop operation is not limited to the environment (if that's the...

View Article
Browsing all 23247 articles
Browse latest View live


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>