Category "python"

How to export Pandas DataFrame to HTML but without any formatting?

I want to export a DF with Pandas to an HTML formatted table, but I don't want any of the default styling that Pandas does to its tables, and would prefer just

What exactly causes the "unable to get local issuer certificate" error when accessing an otherwise accessible (via browser) website URL?

I'm on macOS Monterey 12.3 running Python 3.9.7 installed via brew. Given this minimal replication of my production code: import requests try: response = r

how to create a program that writes a print("hello world"), in the main file where the original program was written? IN PYTHON

how to create a program that writes a print("hello world"), in the MAIN file where the original program was written? IN PYTHON If I want to run a program that W

Get two neighboring non-nan values in numpy array

Let's say I have a numpy array my_array = [0.2, 0.3, nan, nan, nan, 0.1, nan, 0.5, nan] For each nan value, I want to extract the two non-nan values to the lef

Processing British National Corpus (BNC) with NLTk: How to keep spoken texts only?

Following this old(er) post HERE, I wonder if one can keep (extract) spoken samples only? There is a special XML tag (element): is used to represent a spoken t

Having trouble using winapi to read input from a device

I followed the steps here to try and read some input from a device. I've been trying for a couple hours now to figure out why GetMessage doesn't return anything

Is there any solution to fix this Cors error?

I have made an api from django but when I call from my react app It gives CORS error my settings.py INSTALLED_APPS = [ 'django.contrib.admin', 'django.contrib.

Cannot install alembic==1.5.8 because these package versions have conflicting dependencies

I am trying to run a few days using airflow 2.0.2 and I want to install all requirements from this file(https://github.com/aws/aws-mwaa-local-runner/blob/main/d

hand tracking system using opencv error:TypeError: handDetector.findHands() missing 1 required positional argument: 'img'

I'm following an online advanced CV course but the code wouldn't run properly for me. These are the error messages I've gotten: #Traceback (most recent call las

Celery with Server MongoDB

Working on getting Celery setup with a mongodb as result_backend. Following the configuration guidelines set out in the official docs, my celeryconfig.py is set

Renaming identical column names in Pandas [duplicate]

I have a cycle_2 df with the following column names: 3ls 3rs 3ls 3rs 3 absolute_cost 3.00 9.40 9.40

Auto-submit django form without causing infinite loop

I have an issue on my app that I can't work out the best way to approach the solution. I'm learning Django and have little to no experience in Javascript so any

How to fill the textbox background color using Python-pptx?

I am using Python-pptx to create ppt, i want to fill the textbox background with other color. from pptx import Presentation from pptx.util import Inches, Pt fro

Reportlab and pdfrw with matplotlib imshow() error in python3

I've recently updated some code which worked in python2 to python3 and encountered an error using reportlab in conjunction with pdfrw and matplotlib imshow(). C

Why docplex optimization gives no answer

I am working on an optimizatiom model which is set to maximize NPV. I am getting some results, however my cap_ele should represent the max value in the el_to_el

GCloud compute tunnel always shows warning telling to install numpy

I am setting up a tunnel with gcloud from a remote machine with: gcloud compute start-iap-tunnel ... Everything used to be fine until a few days ago when it st

How do I measure the time it takes a for loop to run to completion?

I'm trying to debug the length of time for i in image_list: takes to complete, there are two possibilities as to how this loop ends. Either true or false. True

Tailwindcss LSP for Neovim root_dir issue

I am having an issue with the Tailwind LSP in Neovim 0.5 where the language server running however I get no intellisense when defining a class. I am working on

Extract multiple start date and end date from a string in python?

I am making a resume parser but I want to know the years of experience of the person from the experience section and want results like if there are 3 years of e

Intermediate Output of let' s say Resnet50 from Keras Model

import keras print(keras.__version__) #2.3.0 from keras.models import Sequential from keras.layers import Input, Dense,TimeDistributed from keras.models import