Category "python"

How to save each output by iteration of a loop in separate csv files

I have a file in which i calculate a startdate and enddate, these dates change by iteration each time between a range of dates. the code works fine but i don't

Transform a dataset from wide to long pandas

I have a little problem with the transformation from wide to long on a dataset. I tried with melt but I didn't get a good result. I hope that someone could help

SQLAlchemy column name with space

I'm trying to filter a table on a column that contain spaces. ... events = database_session.query(table) events.filter(table.column with space == 'xvalue') &

Importing cantera (package) in google colab not working

I am not able to solve the following problem: For my research I would like to use a Google Colab notebook to perform my data analysis. To this end I need a pack

Python modulo returning wrong answer

I was attempting this question on leetcode using python3. My solution for this problem is as follows: class Solution: def __init__(self): self.memo

How to add subdomain for endpoint in Python EVE

I am using Python Eve for creating different endpoints. I want to add subdomain to certain endpoint. There is an way to create this through their custom endpoin

Python: Is there any way to get the n-th order antiderivative of a periodic 3D signal/field without padding data?

As stated in the title, I want to obtain the n-th (e.g. 4-th) order antiderivative of a 3D field (e.g. array with shape (1024,1024,1024) ) with period L on each

i am not get linkedin profile picture url in extra data using django allauth linkedin login

i can't get linkedin profile image in extra data when login using django-allauth. in extra data, profile picture url does't exist. i am using django==4.0.4, dja

I keep getting the error "[Errno 21] Is a directory:" when recalling a text file from a zipped file

I have a zipped file that I have unzipped that contains text files in the date format "yyyymmdd.txt" and when I try recalling a certain date's file I keep getti

How can I determine validation loss for faster RCNN (PyTorch)?

I followed this tutorial for object detection: https://pytorch.org/tutorials/intermediate/torchvision_tutorial.html and their GitHub repository that contains th

AttributeError: 'NoneType' object has no attribute '_with_attr' Brownie

I was following the freecodecamp smart contract course, i was in lesson 6 brownie Fund me/ when i was setting up my test it showed me the next error: platform w

openpyxl: ValueError: Value must be one of {'selection', 'data', 'field'}

There is an xlsm file which I need to open and edit and extract data as per the macros enabled in the sheet. But I'm not able to open the file itself. I tried:

Python - Dash input box is being reset even on `dash.no_update`

I am creating a web interface based on Dash, where any client can control something on the server. The web clients are updated regularly based on dcc.Interval c

populating dataframe with youtube api

list2=['PewDiePie', 'jacksepticeye', 'iDubbbzTV', 'Markiplier','MarkiplierGAME', 'EminemMusic','EdSheeran', 'TaylorSwift', 'CNN', 'FoxNews', 'CBCNews', 'ABCNew

(WinError 2) The system cannot find the file specified on Sublime Text

Trying to run simple Python code on Sublime Text editor but getting the following error: [WinError 2] The system cannot find the file specified [cmd: ['py', '-u

An error occurred while performing face recognition using opencv

I took a face recognition lecture using opencv and I followed it, but I get an error import cv2 model = 'data/res10_300x300_ssd_iter_140000.caffemodel' config

What does the "at" (@) symbol do in Python?

What does the @ symbol do in Python?

Attribute Error on predicting the image 'DirectoryIterator' object has no attribute 'Filepath'

I am working on a CNN architecture with an image RGB dataset that belongs to two categories, i.e., crops and another one is grass. However, I am concerned about

Image segmentation for extracting letters

I am trying to extract the individual letters from the below image Below is the code which I implemented for the segmentation img = cv.imread('image10.jpg') i

download an image as a temp file and setting it as pixmap

I'm downloading a YouTube video thumbnail and saving it as a tempfile. I'm then getting a pixmap out of that tempfile and later I can set it to a label, it will