Category "python-3.x"

fastai.text NameError: name 'BaseTokenizer' is not defined

I am a beginner of fastai and trying to build a model referring to Using RoBERTa with fast.ai for NLP. I was trying to customize the tokenizer (as the code belo

Getting a 'CalledProcessError.... returned non-zero exit status 1' on running tabula.read_pdf() function on python 3.6

I have tried all possible options. Please help I am getting the following error while running the read_pdf() of tabula in python. The error is CalledProcessE

ValueError: There may be at most 1 To headers in a message

I am trying to write a very basic email sending script. Here is my code .. import smtplib from email.message import EmailMessage msg = EmailMessage() msg.set_c

ParallelSSHClient - Python - Handle authentication errors

I have a problem which I didn't found the solution here. I am working with SSHClient for connecting to multiple servers. But, if there is 1 server in the list t

How to write if else inside an if...else statement in python?

i am new to python and in this code i want to check if bid_data[8] not equal to '' then the below code runs otherwise only bidno = bid_data[0].split(":")[-1] sh

Lists stored as values in a dictionary of variable length - how to access all the last list items?

What is the most efficient way to access all the last list items of lists stored in a dictionary? Please note that I am looking for a solution that works indepe

Can I get incoming extra fields from Pydantic?

I have defined a pydantic Schema with extra = Extra.allow in Pydantic Config. Is it possible to get a list or set of extra fields passed to the Schema separatel

Shareplum : ConnectionResetError: [WinError 10054] An existing connection was forcibly closed by the remote host

I'm importing .xlsx file to Sharepoint using Shareplum, i found that when the excel is more then 30MB i get the error ConnectionResetError: [WinError 10054] An

Message: Tried to run command without establishing a connection

New to this, apologies for the novice question. Trying to run a script using Python, Selenium and the unittest module. Have the typical setUp(), test_1, test_2

How can I reduce the artifacts generated during "Thin Plate Spline" interpolation in Python?

At the Top "right", there is the 2D-density plot of the recorded data (actual), fewer in number. On the top-left is the interpolated data (thin-plate), i.e. la

json.dumps on dictionary with bytes for keys

Trying to convert dictionary object with keys of type bytes to json using json.dumps(). Format of dictionary object is not known beforehand. Have found solution

labels and the predictions of multiclass images images Index Error: list index out of range

I am training a CNN with an dataset of images that consists of 2410 RGB images and belongs to two categories, i.e., crops and another is grass. After training t

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