Category "python"

VS Code's Python Debugger doesn't hit the breakpoint for Odoo 10

I use VS Code extension Python version 2.2x, Python interpreter version 2.7x, and use Odoo 10 of the latest version. I'm using WSL with Ubuntu 18.4 LTS. I canno

Creating Sales Order and Sales Lines in Microsoft Dynamics using OData and Python

I am working on integrating Microsoft Dynamics NAV 2013 R2 with my Python application. My objectives for this integration are: Query all the Sales Orders Create

Updating Created Custom KivyMD Property

I'm hoping there's a way to do this but not entirely sure. I want a way to update all of my labels after a button press. This is how I'm currently doing it whic

ModuleNotFoundError: No module named 'azure.cosmos' on azure function in visual studio code

I've been trying to incorporate azure.cosmos into a azure function without using binding since the scenario isn't beneficial for it. The problem every time i tr

Python/Pandas Calculate the mean time (hour) of a Datetime column

I have a Pandas DataFrame (data) with a column ['Date'] in DateTime (date and time) which represents the time of arrival. How to calculate the mean of only the

Web scraping from html code of a database using python

I am new to python and am learning things slowly. I have earlier performed API calls from databases to extract infromation. However, I was dealing with a partic

How to input a history of vectors to LSTM based network instead of a single vector?

I am trying to predict a simple pattern using LSTM based network. I input a single vector and get the output vector with the same shape as a prediction. How can

Filter dictionary of tuples with duplicated first element of the values based on some condition

Sample input data in which Value1 is duplicated across several keys {'Key1': ('Value1', '28.302', '30', '131', '10', '321'), 'Key2': ('Value2', '42.373', '44'

Chatbot-specific answers

I'm creating a chatbot that asks questions and answers questions, but for now it doesn't have a specific function of answering specific questions that it asks i

Python mock.patch() not mocking imported class module

I have a some code that looks like this (abridged): ## ./module_1/lambda_function.py from shared.graphql_helpers import GraphQLClient gql_client = GraphQLClie

How to return and download Excel file using FastAPI?

How do I return an excel file (version: Office365) using FastAPI? The documentation seems pretty straightforward. But, I don't know what media_type to use. H

Plotting the frequency of occurrences per date

I'm new to pandas and plotly. And I have a large csv file with two columns, a date column and a column that contains a string of text (event). Each event is a n

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