Category "python"

Cant run flask on ngrok

from flask import Flask, escape, request app = Flask(__name__) run_with_ngrok() @app.route('/') def hello(): name = request.args.get("name", "World") ret

Can´t copy tupel from one dataframe into another (Length of values does not match length of index)

I want to create columns in a dataframe (df_joined) that contains as values tupels from a second df (df_tupels). The tupels are (10,50) and (20,60). I tried var

Changing the time scale of a matplotlib graph in a real-time fashion

I'm making a real-time application that graphs sensor data in a real-time fashion. The data is saved to a .csv file and graphed using matplotlib in the followin

NameError: name '_mysql' is not defined - Django tailwind

When I run python manage.py runserver, my django server runs and I can see my webpage, however some of the tailwind doesn't work. When I then stop that server a

download the data day by day from ERA5

How to create a script using python (api code) to download daily data using (for loop) from ERA5, to make a circulation day by day during the year? notice, I ha

How to extract all text from pdf?

I'm using the PYPDF2 lib to extract texts from a PDF but I'm having a problem doing the loop. I'm using the following code and I can extract a string from the f

When I Run My Code I Get A Huge Error In Python

If I Run This Code: import re mapping = {'gde1': 'a', '4&TW': 'b', 'E#ZB': 'c', 'B0F&': 'd', 'uvRD': 'e', 'M7vr': 'f', 'X$*d': 'g', 'XQ%R': 'h', 'jma+':

Google Colab error: Import "tensorflow.keras.models" could not be resolved(reportMissingImports)

import tensorflow as tf tf.__version__ !sudo pip3 install keras from tensorflow.keras.models import Sequential from tensorflow.keras.layers import Dense, Conv

Extracting information from website with BeautifulSoup and Python

I'm attempting to extract information from this website. I can't get the text in the three fields marked in the image (in green, blue, and red rectangles) no ma

Why does kivy show me a white background instead of the real rgba number?

In this program i set the background color of Label to 6, 61, 81, 1 like this : background_color: 6, 61, 81, 1 canvas.before: Color

Python cv2.VideoCapture() has wrong resolution and read cropped images

I'm trying to read images from an IDS GV-5240CP camera plugged to my laptop via ethernet using Python and OpenCV. This is what I am supposed to get : A 1280x102

How to get VS-Code style Intellisense(Case Insensitive and Intelligent) in jupyterlab?

TLDR version: How to make JupyterLab Autocomplete case insensitive? I would like to have Visual Studio Code style Intellisesne(prediction and auto complete) in

How to speed up search for abundant numbers?

Is there a way which this code could be improved so that it would run faster? Currently, this task takes between 11 and 12 seconds to run on my virtual environm

pyweka warning on a model

my question is why i receive this warning: java.beans.IntrospectionException: Method not found: isNumToSelect java.desktop/java.beans.PropertyDescriptor.<

Using xpath method in selenium in python - no such element: Unable to locate element

kinda new in the selenium, I'm trying to reach a "submit" element in a very long xml page. Here is my code: import pip import time import autoit #import seleniu

How do I use pyscript in my HTML code and return output

I am trying to call my python function created. But not getting any output and no resource how to achieve. Code : <!DOCTYPE html> <html> <head>

how to restart subprocess if it crashes?

I'm trying to restart a subprocess if it crashes, but somewhy this loop just doesn't work. I've been wondering if that's even possible? def dont_stop(conv):

Does this function computeSVD use MapReduce in Pyspark

Does computeSVD() use map , reduce since it is a predefined function? i couldn't know the code of the function. from pyspark.mllib.linalg import Vectors from py

Insert variable with iteration into list display as variable with interation

I want to automate a list that looks like this in python. weights = [x[0],x[1],x[2]] I have written code but it just gives the value of iteration. I want to

nvcc not found when source installation

I want to install pytorch3d from source with the following command as recommended at Link: git clone https://github.com/facebookresearch/pytorch3d.git cd pytorc