Category "python"

How do I delete trailing objects drawn in tkinter?

My goal is to allow you to make a rectangle on your screen similar to using a rectangle or selection tool in paint. I've got it to mostly work but when you make

How to replace [UNK] tokens with original tokens in BERT nlpaug

I am trying to use nlpaug to swap some words out but am having issue with it replacing tokens permanently with the [UNK] token. I am using the docs here: https:

Python code to connect to MySQL database doesn't work on Google Colab

I wrote the code bellow. It works on a .py file on my computer but not while running on Google Colab) import mysql import mysql.connector as msql from mysql.con

Remove rows in dataframe based on value counts of unique identifier

Identifier Value_1 Value_2 Value_3 123 20. 30. 1 123. 12. 14. 1 123. 18. 12. 1 124. 12. 10. 6 124.

Import issue in Djoser- Django

I'm trying to build an user authentication system with React and Django. I'm using JWT, Djoser for authentication model. serializers.py: from djoser.serializers

Import serial doesnt work after using pip install pyserial

After installing pyserial, I still get the error: "ModuleNotFoundError: No module named 'serial'" This is the beginning of the code: import serial import time

inserting line of code in the same module according to user input

I'm trying to insert new lines of codes in the same running module every time the user input something. I tried with open function but this function in exe prog

NLTK find german nouns

I want to extract all german nouns from a german text in lemmatized form with NLTK. I also checked spacy but NLTK is much more preferred because in english it a

drf - trailing / in url throwing error while calling post api

views.py class FurnitureViewSet(mixins.ListModelMixin, mixins.RetrieveModelMixin, GenericViewSet): permission_classes = [AllowAny] serializer_class = Fu

how do we can make amazon like search suggestions using elasticsearch (note:amazon is using elasticsearch )

this is what exactly I wanted Am using elastic search , my suggestion is working but I need a search suggestion like amazon. is it possible using elastic search

Python Dash - add submit button at the end of multiple inputs. Also format output table nicely

Want to create a dash board, with two or more inputs, a submit button at the end of inputs that outputs a table. I am having trouble creating properly spaced in

tweepy.errors.Forbidden: 403 Forbidden using Twitter API v2 functions in Tweepy?

I am just starting out with using Tweepy and have been having trouble when trying to use the v2 API functions to write a program to Tweet text. Currently, I am

"ModuleNotFoundError: No module named 'dbus'" on macOS

I'm getting an error when I'm using the notify2 module. ModuleNotFoundError: No module named 'dbus' The error is from the notify2.py file. When I tried pip in

How to add new column to pandas group? Pandas forgets the column

I have a pandas dataframe indexed by createdAt grouped by pid (participant identifiers). The created at column are unix timestamps. Now I would like to add a ne

How does the axis parameter from NumPy work?

Can someone explain exactly what the axis parameter in NumPy does? I am terribly confused. I'm trying to use the function myArray.sum(axis=num) At first I t

out of memory error when reading file with json.loads in python

hi i create a file and fill it with below code: i have some lists which i fill them and write them in file. each list will be written in one line. import json

Getting the current selected tab name of ttk notebook in tkinter? - python

I'm creating a GUI that shows different plot types in different tabs, so I created this helping function and I'm trying to figure out how to get the current tab

Creating a summary statistics table in python

I am trying to recreate the 'SummarySE()' function from R in python but I am having trouble getting it to work. The function creates a summary stats table from

generate_tfrecord.py: error: unrecognized arguments - error while trying to create TF Record files for test and train data

While using the generate_tfrecord.py, I'm always getting this error of "generate_tfrecord.py: error: unrecognized arguments". But, I haven't changed anything, a

Using metamask to authenticate a SSO flow

Is it possible to do something like a social signup/login using crypto wallets like Metamask? Analogous to signup/login with Google/Facebook/Apple... Does the c