Quantcast
Browsing all 14097 articles
Browse latest View live

How to calculate CRC32 with Python to match online results?

I'm trying to calculate/generate the CRC32 hash of some random strings using Python but they do not match the values I generate from online sources. Here is what I'm doing on my PC,>>> import...

View Article


joblib: Can not load dumped model from another subfolder of parent directory

I have train a small model and use joblib to save it.But i get an error while trying to load it.This is my structure of directory:loader.pypackage model_folder __init__.py model.py model.pkl...

View Article


Websocket Error: Exception inside application: 'set' object has no attribute...

I'm learning Django for a school project and I'm trying to create a websocket server using Django Channels with Daphne and Redis, but I receive the error "AttributeError: 'set' object has no attribute...

View Article

Visual Studio Code inputs everything in terminal

I'm trying to run a code in VSC that inputs a string and changes every vowel to 'p' letter.It works most of the time but sometimes it inputs everything in terminal (like file path) and changes all...

View Article

python: create empty dataclass and populate it on demand

python newbie: I need to create an empty data model class, populate it with values and then convert it to JSON string, however i am missing something important here. see error belowmy data class:from...

View Article


Using Python to get a solution to a system of linear equations with as many...

I'm trying to solve a linear system of equations in Python with a very sparse, relatively big matrix (size around 10 x 10000). Using Numpy, it was easy to get a numerical solution using the least...

View Article

LeetCode question Removed Duplicates From Sorted List

I tried the method where you go through the head, compare it to the curr of the new ListNode I made. If it doesn't exist already, add it. However, it looks like it doesn't work properly for duplicates...

View Article

Zapier "Run Python Code" Error - Issue parsing dictionary

I'm just learning how to write python, but I've been using Zapier to start automating some tasks. (Also first time poster so hello everyone!)I have the following data:countries = [ {"Country_Num": 1,...

View Article


Jupyter Lab issue displaying widgets (javascript error)

I have troubles replicating a JupyterLab install on a new PC. It is working fine on my previous one.I am unable to display simple widgets (like a checkbox from ipywidgets or ipyvuetify).I checked that...

View Article


Get all (n-choose-k) combinations of length n

How can I get all combinations (in order) of length n from a list of numbers? For example, given the list [1, 2, 3, 4], and setting n = 3, how can I get these results?[1, 2, 3][1, 2, 4][1, 3, 4][2, 3,...

View Article

What is the most common way to wrap (def) function? [closed]

When I put a lot of variables in one method, the code line become very long and ugly.I'm using the type 1 to shorten the codes, but I'm curious what other people use.Type 1:def my_func( var1: str,...

View Article

Why isn't my scrapy pagination by brand using counter working?

Code isn't working. I'm trying to scrape multiple pages from differents brands (categories). The page that I'm using have a list of all the brands. The brands are arranged in groups, which are...

View Article

como hacer un proyecto multi usuario en django [closed]

Necesito un proyecto con multiples usuarios para diferentes apps y sobre todo una validación para que en el login cada usuario sea redirigido a la vista con los permisos correctos, inicialmente pensé...

View Article


Deriving correlation coefficient on a grouped Pyspark dataframe

I have been struggling implementing the following function.I would like to apply first groupBy operation to customer_name and for each group, I would like to calculate Pearson correlation coefficient...

View Article

Python function argument list formatting

What is the best way to format following piece of code accordingly to PEP8:oauth_request = oauth.OAuthRequest.from_consumer_and_token(consumer, token=token, verifier=verifier,...

View Article


error while downloading Tensorflow Object Detection

erorr:AttributeError: module 'keras._tf_keras.keras.layers' has no attribute 'experimental'This happened when I was trying to verify if I had correctly downloaded tensorflow object detection.This is...

View Article

Troubleshooting Django Logout Error: Despite Correct Implementation, Logout...

I get this error every time I press the logout button, which is weird because I did all the right steps and still have the same result.The errorMethod Not Allowed: /accounts/logout/[03/Apr/2024...

View Article


How to add a background image into pygame?

new to pygame just wondering how i would go about adding a background image into the game itself? this is my code so far, i've been using the bg as a way to import my image but the py file itself...

View Article

Why isn'it working ?? Pygame ModPlug_Load failed I want it like Jarvis

[[enter image description here](https://i.stack.imgur.com/HzAaP.png)](https://i.stack.imgur.com/RzpLL.png)Concept from : https://youtu.be/e_nKCZe6Ikc?t=161I try to run this code, I ask Chat gpt to help...

View Article

Trying to choose first audio stream of specific language in ffmpeg using python

I have .mkv files that some of them have more than 1 audio stream in the same language so i need to first map the audio streams with specific language and then use only first of them to output .mp4...

View Article
Browsing all 14097 articles
Browse latest View live