Category "python-3.x"

Does a Pipeline object store the score of the data it trained with?

I was wondering if a saved model in a Pipeline object contains the score of the data with which it has been trained. If so, how to get that score without having

specific text in prompt for pythonscript

In JavaScript, you can use prompt("This text is above the field of the prompt.", "This text is in the field of the prompt.") to get a customized window appearin

Getting Bad Gateway and Connection reset by peer using asyncio + aiohttp

Is there some async expert with sharp eyes around? I am using asyncio (Python 3.9) with aiohttp (v3.8.1) to fetch multiple urls asynchronously through a proxy,

Error trying to create a database: sqlalchemy.exc.OperationalError: (sqlite3.OperationalError) unable to open database file

I'm trying to create a database using Flask and Sqlite3, I am not sure this error is about the file path, as you can see in my code I have tried out different w

Can anyone explain the working of jsonld.compact() ? Wasn't able to find detailed documentation or examples for the compact() method

def process_all_imdb(cursor, imdb): for i, mid in enumerate(get_movies_to_process(cursor)): print "// %d movies processed." % i movie = get_

Problems with pip und Command line

I am trying to create a Python pip package. This works also well. I can successfully upload and download the package and use it in the Python code. What I can't

IndexError: list index out of range with api

all_currencies = currency_api('latest', 'currencies') # {'eur': 'Euro', 'usd': 'United States dollar', ...} all_currencies.pop('brl') qtd_moedas = len(all_curr

IndexError: list index out of range with api

all_currencies = currency_api('latest', 'currencies') # {'eur': 'Euro', 'usd': 'United States dollar', ...} all_currencies.pop('brl') qtd_moedas = len(all_curr

How to fix the NumPy .dtype 'NoneType' error

I am running the following Python code in PyCharm debug mode. import numpy as np, pandas as pd, numpy.polynomial.chebyshev as chebyshev from pathlib import Path

Some one can explain to me how this code executes ? I still mess up with recursion

That output is supposed to be 4,3,2,1 right? def test(x): if x > 0 : test(x - 1) print(x) test(4) #output => 1 #output => 2 #output => 3 #outp

Why does the print function return None?

I'm trying to understand why the outer print returns None. >>> a = print(print("Python")) Python None >>> print(type(a)) <class 'NoneType'

ModuleNotFoundError: No module named in another submodule

I have read a couple of threads on StackOverflow but did not find any answer that has fixed my problem. I'm pretty new to Python and cannot figure out how does

python regix how to split two word and add comma? [closed]

This is my string: Hair ReplacementHair BraidingHair Supplies & Accessories my expected result should be: Hair Replacement,Hair Braiding,

Issue with nested functions, inheritance and multithreading in python

I'm trying to automatically take data from several websites. I defined a class class Site1Scraper: def __init__(self): ... def f1(self): ... def f2(

OCPP python server issue

I successfully tested the OCPP server by mobility house integrated with aiohttp API in local network. But now I am deploying the websocket server integrated wit

How to resolve Key Error Exception when accessing dictionary key inside an if statement

I'm currently developing EV calculator using python and django. I get a key error exception when trying to access a dictionary key in an if statement inside a f

How to change the size of an image in Azure's custom vision service?

I want to train model by using custom vision but when i add images in custom vision. Custom vision convert resize my image into (512,512). If there is any optio

Python GUI with Multithreading - how to manage threads

I am new to Python. I have been trying to develop a GUI based tool to monitor a set of databases. I want to pull data with multiple threads to make the DB reads

Sum dictionary values stored in Data frame Columns

I have a data frame having dictionary like structure. I want to only sum the values and store into new column. Column 1 Desired Output [{'Apple':3},

Convert Json file to a serializable string using python

I have a json file like below {"a": "a_value", "b": "b_value" } I would like to convert it to the below using python3 {\"a\": \"a_value\", \"b\": \"b_value\"}