Category "python"

openAI DALL-E ModuleNotFoundError

I installed DALL-E following the instructions on https://github.com/openai/DALL-E and got : ---> 10 from dall_e import map_pixels, unmap_pixels, loa

How to specify a proxy in transformers pipeline

I am using sentiment-analysis pipeline as described here. from transformers import pipeline classifier = pipeline('sentiment-analysis') It's failing with a con

Pandas cannot open an Excel (.xlsx) file

Please see my code below: import pandas df = pandas.read_excel('cat.xlsx') After running that, it gives me the following error: Traceback (most recent call las

Count occurrences within a specific range

I have a data frame that looks like this: Tag 0 skip_1 1 run 2 skip_1 3 run 4 skip_1 5

How do I convert numpy.datetime64('2022-04-20T00:00:00.000000000') to datetime.date(2022, 4, 04)

I have a column df['Date] which is a datetime64[ns] type and after doing the sheets= sorted(df['Date'].unique(), reverse =True) I get a numpy.datetime64('2022-

Missing argument is required | Discord.py

I tried to make an command which displays mentioned users avatar. This is the code: @client.command(aliases=['av']) async def avatar(ctx, *, member: discord.Mem

Scipy minimize returns a higher value than minimum

As a part of multi-start optimization, I am running differential evolution (DE), the output of which I feed as initial values to scipy minimization with SLSQP (

selenium twitter login without new device notification

Is there a way to log in to twitter with selenium/python without getting the notification "login from a new device" on Twitter? Current code is import urllib.re

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

Syntax Error when deploying django on apache2

I am trying to host a django application on a server using apache2 and mod_wsgi. The project itself is located at the path /usr/share/django-projects/mysite The

TypeError: This COM object can not automate the makepy process - please run makepy manually for this object

What this kind of error? Traceback error C:\Users\DELL\PycharmProjects\MyNew\venv\Scripts\python.exe C:/Users/DELL/PycharmProjects/MyNew/agaaaaain.py Traceba

VPython acts weird when used with python installation and won't shut down nicely

I want to build physics simulations using VPython. Although, VPython works great on websites like trinket.io, I'd like to use a nicer IDE than the web one, and

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

ValueError: Cell k2 doesn't contain an image

I am stuck with this python code regarding SheetImageLoader. The error message says that there's no image in the cell I am referencing, but there's an image in

Unable to resolve pandas encoding error by changing encoding

I'm having trouble resolving an encoding error when reading a csv file using the pandas library. import pandas as pd filepath = "D:\Datasets\2019HighwayBridgeIn

Install OpenEXR for python failed

I'm trying to install OpenEXR. Using : MacOS 10.14.5 Python 3.6.5 Xcode Version 10.2.1 I tried pip install openexr but got the following error: Collec

How could I call hundreds in python?

When I split certain numbers into "ones" and "tens" in python, like that (98) we code >>> num = 98 ones = num % 10 tens = num // 10 print(ones) = 8

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

How to headless mode with --user-data-dir=chrome-data chrome option

I am using python selenium for implementing tests. I need to keep login process so I don't log in every time. I use add_argument("--user-data-dir=chrome-data")

Execute Process Task in SSIS for Python Script

I'm trying to execute a python script by SSIS Execute Process Task. The Python script is correct. This script read data from yfinance and do some calculation,