Quantcast
Browsing all 13981 articles
Browse latest View live

How to increase process speed using read_excel in pandas?

I need use pd.read_excel to process every sheet in one excel file.But in most cases,I did not know the sheet name.So I use this to judge how many sheet in excel: i_sheet_count=0i=0try:...

View Article


Image may be NSFW.
Clik here to view.

How to install the correct version and content of kerasNLP with pip?

My EnvironmentOS: windows 10python version 3.12.2pip 24.0had never install tensorflow , keras or keras_nlpI try to run following commands to install keras_nlp and keras following this introduction.pip...

View Article


Pyspark Group By Date Range

I have a sample pyspark dataframe that can be created like thissample_df = spark.createDataFrame([ ('2020-01-01', '2021-01-01', 1), ('2020-02-01', '2021-02-01', 1), ('2021-01-15', '2022-01-15', 2),...

View Article

Image may be NSFW.
Clik here to view.

in Tkinter i am facing problem of opening extra small blank tk frame

import osimport tkinter as tkfrom tkinter import RIDGE, Button, Frame, Label, Tk, Toplevel, filedialog, messageboximport cv2from PIL import Image, ImageTkimport pkg_resourcesfrom main import...

View Article

Getting "422 Unprocessable Entity" error when positing stringified body from...

I have this request, on my node.js application :return new Promise((resolve, reject) => { const options = { hostname: 'py', <== docker container port: 8000, path: '/resume', method: 'POST',...

View Article


How to initialize PRNGs to produce identical output in both Julia and Python?

I have the following Julia code to generate synthetic data.using Statisticsusing Randomseed_value = 42Random.seed!(seed_value)f(x, t) = 3.2 * (x + 0.2t)n_meas = 20X = zeros(n_meas, 2)X[:, 1] .= 1 *...

View Article

FileNotFoundError when I call a file with read_csv from an other directory...

In my code I have a file called location.py where I read a file that I use for a function assign:import pandas as pdfilename = '../../Dataset/Import.csv'df = pd.read_csv(filename, sep='\t',...

View Article

How do I get doctest to run with examples in markdown codeblocks for mkdocs?

I'm using mkdocs & mkdocstring to build my documentation and including code examples in the docstrings. I'm also using doctest (via pytest --doctest-modules) to test all those examples.Option 1 -...

View Article


How can resources be provided in PyQt6 (which has no pyrcc)?

The documentation for PyQt6 states thatSupport for Qt’s resource system has been removed (i.e. there is no pyrcc6).In light of this, how should one provide resources for a PyQt6 application?

View Article


Python proxy to validate request to database

Users send queries to the database through different clients. All these clients use the http port of the database (yes, it accepts requests via http). Let it be port 123. I want to put my http proxy...

View Article

How to analyze and connect rows in multiple csv files (python)

I have multiple csv files that are all of format:date, time, name1, name2, number1,number2,number3,number4,number5,number6,number7What i want to do is get the max numbers1-7 by connecting rows from...

View Article

How do you mock urllib.requests.urlopen?

I'm making a screen-scraper that collects schedule data from a TV channel website. To do that, I have to fetch the website's raw HTML. I'm trying my hand at unit-testing for the first time and I have...

View Article

Changing the number of hidden layers in my NN results in an error

As the title says, if I change the number of hidden layers in my pytorch neural network to be anything different from the amount of input nodes it returns the error below.RuntimeError: mat1 and mat2...

View Article


WebScraping Company Names with BeautifulSoup

I'm trying to pull the company names from a website and have not been able to produce anything. I'm not sure if I'm selecting the wrong class or what I'm doing wrong.Site:...

View Article

Gensim HDP - Top Topics' distribution for document

I want topic distribution for my documents. However, Gensim's HDP's show_topic()returns 20 topics by default. And I suppose they are not supposed to be the best. After digging deeper, I found out there...

View Article


Extract each column as image from scanned pdf

I need to crop each column from scanned pdf. I tried lots of solution from here but none of them worked.For example I have below image.https://i.stack.imgur.com/YdPSG.jpgI am using below script to...

View Article

How do I resolve this LoRA loading error?

I'm trying to run through the LoRA tutorial. I've gotten the dataset pulled down, trained it and have checkpoints on disk (in the form of several subdirectories and .safetensors files).The last part is...

View Article


Image may be NSFW.
Clik here to view.

How can I configure an enum list in FastAPI?

I have a FastAPI endpoint that fetches all database records for an entity, applying a payload. One of the payload fields refers to the order when bringing the data (which can even be by more than one...

View Article

Some divs didn't appear during web-scraping

I'm new to web-scraping and I try to scrape the content from this website:INFOBANJIR JPS SELANGORThis is the content that I'm trying to scrape:ONLINE RAINFALL DATA (MM)This is my code:from bs4 import...

View Article

Can I build in a pause between executions in cloud functions?

I have a python script that executes every time a file is uploaded in a storage container. If I upload many files at once, only 2 rows show, the oldest file and the most recent (I think). Is there a...

View Article
Browsing all 13981 articles
Browse latest View live