Category "python"

Column Inheritance for Independent ORM Mapper Classes In SQL Alchemy

I am trying to replicate the following SQLite CREATE TABLE statements using the declarative ORM mapper classes in SQLALchemy. CREATE TABLE IF NOT EXISTS questio

How to get categorical values in catboost

This is my data. I created a model with CatBoostClassifier(). I can get the feature names list with: >>> model.feature_names_ ['title', 'value'] Firs

How to improve the visibility of numbers on license plate for OCR

I am using easyocr methods to recognize the text on the license plate but the results are not good. I have developed deep learning model which detects license p

How to merge every two columns, with pandas, substituting only if the left column value is nan or 0 [duplicate]

I have 2n columns and each pair looks like this: 1 0 2 0 45 1 44 10 43 22 0 55 0 46 0 75 I want to turn each pair of columns int

How can the __init__ method accept objects and assign attributes if the attributes have not been created in the Constructor? [duplicate]

I am new to OOP in Python. As the title suggests, I am unsure as to how the __init__ method can assign attributes to an object of a given clas

Why can't I import requests in VS Code?

I want to use request module, but whenever I tried to import requests I got this message: import "requests" could not be resolved from source Pylance I already

ValueError when using ModelCheckpoint in Keras

I'm creating an Ensemble of Vgg19, DenseNet, and EfficientNetB1. The code is as follows: IMAGE_SIZE = (224,224,3) import tensorflow as tf vgg19 = tf.keras.appl

Kivy/MySQL/colab-google Mysql request does not work

I'm using python/Kivy/MySQL/colab-google to compile an apk. When I run the app on Android, I give the command to register the app shuts down. main.py import k

Combining of two lists in python [closed]

I have two lists with elements and an empty list: l1 = [1,2,3,4,5,6] l2 = [7,8,9] l3 = [] How can I add the elements of l1 and l2 into l3, li

AttributeError: 'Model' object has no attribute '_distribution_strategy'

I'm trying to train a UNet, but for some reason I get the following error: Traceback (most recent call last): File "<ipython-input-54-b56497e81356>", l

Promoted Widget in Qt Designer does not instantiate children

Problem I promoted a widget in Qt Designer and it worked, the problem is that when I run the program, it doesn't show the children of this widget that I created

Discord.py: How to fix "event loop is closed"

I am new to programming. I am trying to have my discord bot open up command prompt to confirm it can run, but I am getting this error: File "C:\Users\---\Ap

ModuleNotFoundError: No module named 'yfinance' - Importing Yahoo finance & Financials to Python

I'm using Mac OS and receiving an error when doing the following: import pandas as pd import yfinance as yf from yahoofinancials import YahooFinancials Module

'str' object has no attribute 'decode' for tensorflow in colab?

I'm a beginner of deeplearning.I copied the code with python3 in colab. Code is from the book called"Book - Practical Deep Learning for Cloud, Mobile & Edge

matplotlib: values for the (xx-small, x-small, small, medium, large, x-large, xx-large, larger, smaller) special sizes

The matplotlibrc sample file states that: ## The font.size property is the default font size for text, given in pts. ## 10 pt is the standard value. ## ## Note

catch git output from flask

I'm trying to roll out a quickie flask app to get git statistics from a certain repo for coworkers to see. import os, sys from flask import Flask, Response ap

Passing quoted argument in json payload to shell script

I am working on a python script that passes arguments to a shell script that lives in a Docker container. I'm achieving this using this Go webhook tool (https:/

Apache Beam pipeline with Write to jdbc

I am trying to create a pipeline which is reading some data from Pubsub and writing to into a postgres database. pipeline_options = PipelineOptions(pipeline_arg

Sort Tensorflow HashTable by value

My Code : h_table = tf.lookup.StaticHashTable( initializer=tf.lookup.KeyValueTensorInitializer( keys=[0, 1, 2, 3, 4, 5], values=[12.3,

How to download a full package dependency chain using conda?

I have a requirements file that describes the conda packages I need. These are required dependencies in a script I want to run. The script needs to run on a mac