Quantcast
Browsing all 14069 articles
Browse latest View live

Image may be NSFW.
Clik here to view.

Python Find Contours white region only OpenCV

I am currently learning Python and OpenCV, and I'm attempting to locate the center of each shape in an image using contours. However, when I implement the code, I'm obtaining multiple cx and cy values...

View Article


How to change the root directory for the Jupyter notebook in Windows?

I can't «persuade» Jupyter to use another directory then the default one for storing its projects.I edited the following parameter of the jupyter_notebook_config.py file (I tried all three variants...

View Article


Scaling a figure to fit in a pdf page using reportlab, and svglib

I stumbled on this code to generate a PDF with a plot in it without saving the plot as a file.I am now trying to scale the svg before adding it to the PDF so it fits the page (without changing the...

View Article

Apply expanding function over whole df - numba and alternatives?

I want to apply an expanding window operation on the whole df - not columnwise.The method=table requires numba engine. But I always get an error when calling it (see below)I would also appreciate it,...

View Article

How to derive the difference in layer intervals in wells?

wells = [ [[0, 4, 'soil'], [4, 8, 'clay']], [[0, 4, 'soil'], [4, 16, 'sand']]]layers = ('soil', 'clay', 'sand')i need to write code that will show the difference in depth:the logic is as follows:'soil'...

View Article


Pandas read_parquet() with filters raises ArrowNotImplementedError for...

I am encountering an issue while trying to read a parquet file with Pandas read_parquet() function using the filters argument. One of the partitioned columns in the parquet file has an int64 dtype....

View Article

Working with nested JSON in Great Expectations

I am trying to work with nested json in great expectations. I have managed to achieve the same with following expectation suite and batch modification like...

View Article

Image may be NSFW.
Clik here to view.

ModuleNotFoundError: no module named 'transformers'

This is my first post and I am new to coding, so please let me know if you need more information. I have been running some AI to generate artwork and it has been working, but when I reloaded it the...

View Article


400 Bad Request (error code: 40060): Interaction has already been...

I have added ephemeral commands in my discord bot using interaction.I am deferring the interaction at the first line of code to not terminate the commandHere is my code:@commands.hybrid_command()async...

View Article


What is the difference between i: int = 1 and i = int(1) in Python?

What is the difference betweeni: int = 1andi = int(1)Is the one better than the other?

View Article

pip install -e vs without in terms of preformance

I develop some dependencies locally and I have a dep_requirements.txt file that looks like this:-e path_to_dependency_1-e path_to_dependency_2-e path_to_dependency_3Is it ok to leave it that way for...

View Article

Why does load_dataset give the num_rows = 0?

# The path├── audiofolder│├── clips││├── 01.mp3││├── 02.mp3││├── ...│├── test.csv│└── train.csvcode:from datasets import load_dataset, load_metric, Audiodataset_train = load_dataset("audiofolder",...

View Article

write_pandas snowflake connector function is not able to operate on table

I am working on a python script that is designed to process some data, create a table if not exists, and truncate the table before inserting a refreshed dataset. I am using a role that has usage, read,...

View Article


How to solve Xcode rsync file transfer issue for a kivy-ios application?

I want to compile an application developed with Python and the library Kivy for ios devices. I have followed the process explained at this page and created a Xcode project using the command:toolchain...

View Article

Hi this is sathish and i started learning python kindly answer and explain...

Accept two positive integers M and N as input. There are two cases to consider:(1) If M < N, then print M as output.(2) If M >= N, subtract N from M. Call the difference M1. If M1 >= N, then...

View Article


Bash Commands Do Not execute on my Python `venv` Virtual Environmnent on VSCode

Am Implementing a Flask Webapp that requires a virtual Environment to manage dependencies. I have created a virtual environment called venv. I am Using a Bash Terminal on Visual Studio Code.When I...

View Article

CrispyError : as_crispy_field got passed an invalid or inexistent field for...

I can't expose Email field from User model in django, If I remove email field from register.html there is no error.Also if I use {{ form }} It does not show the email field. It shows username,...

View Article


`ResourceExhaustedError: Graph execution error` when trying to train...

A few days back, I got the same error at 12th epoch. This time, it happens at the 1st. I have no idea why that is happening as I did not make any changes to the model. I only normalized the input to...

View Article

Image may be NSFW.
Clik here to view.

Why is there grid lines for some plots and not for others?

Consider this MWE,from matplotlib import pyplotpyplot.style.use('classic')pyplot.rcParams.update( {'text.usetex': True,"font.family": "serif",'text.latex.preamble': r'\usepackage{amsmath, amssymb,...

View Article

Get guild details from the user DM using Discord.py

I have created a discord bot which can be invited to guilds and has slash commands. Everything is working fine if a user uses the command in server. But I want to get the guild if user uses that...

View Article
Browsing all 14069 articles
Browse latest View live