Quantcast
Channel: Active questions tagged python - Stack Overflow
Browsing all 23247 articles
Browse latest View live
↧

Python , Websockets , APIi , Unity , Game development [closed]

We are trying to develop a game. At this point, what we are trying to achieve is getting information of TikTok live broadcasts. Comment events, like events or gift events etc. This kind of...

View Article


I'm using %%timeit in jupyter notebooks to get the execution time of my cell

whenever I run the cell the time is coming in microseconds, I want the time in seconds how can I achieve this?enter image description hereI want time in seconds or how can I get the result in another...

View Article


How to webscrape an interactive webpage with python

I would like to know to webscrape the following website: http://chonos.ifop.cl/flow/The web page has a map on the right, when you click on each point it shows on the left time series in Highcharts...

View Article

Is there a Python function for mixed additive and multiplicative combination...

I'm looking for a Python function or method that can handle both additive and multiplicative combinations of parameters.Specifically, I want to first apply zip to certain parameters, then apply product...

View Article

Tensorflow VarLenFeature vs FixedLenFeature

I was trying to save images of different sizes into tf-records. I found that even though the images have different sizes, I can still load them with FixedLenFeature. By checking the docs on...

View Article


How to receive file send from flask with curl?

Here the server side code with python & flask:from flask import Flask, request, send_fileimport ioimport zipfileimport bitstringapp = Flask(__name__)@app.route('/s/', methods=['POST'])def...

View Article

TypeError in imblearn pipeline: type 'Pipeline' is not subscriptable

transform = [("ord", OrdinalEncoder(), ['job', 'education']), ("ohe", OneHotEncoder(), ['contact', 'month', 'poutcome'])]ct = ColumnTransformer(transform, remainder='passthrough')p = imbpipeline[('ct',...

View Article

How to plot the mean of data points in matplotlib

I am trying to plot a graph in Python and new to Python. I have plotted the graph and the means are not at the right place. Could anyone point the mistake in the code:import pandas as pdimport seaborn...

View Article


installing plugins through pip correctly

I am trying to edit some code through idle, and I am trying:pip install --through command prompt, however it does not work and command prompt even says python is not detected on my computer even if I...

View Article


Why doesnt the programm insert the data that i type in? [closed]

import sqlite3import refrom tkinter import messageboxonlyNumber = r'^\d+$'onlyLetters = r'^[a-zA-Z\s]+$'onlyAge = r'^\d+$'def insertStudent(student_id, full_name, age): if re.match(onlyNumber,...

View Article

Python and pip misconfiguration leads to package installation errors

I'm facing an issue with Python and pip where packages are not being installed under the correct version of Python. I am using Python 3.9.6:python3 -VPython 3.9.6The pip versionpip3 --versionpip 21.2.4...

View Article

How to retrieve the value in a json file using data.get

I was able to retrieve values for values data1, data2... using data.get function in Python.data = json.load(file.json)print(f"##vso[task.setvariable variable=var1;isOutput=true]{data.get('A',...

View Article

Image may be NSFW.
Clik here to view.

Cannot Access Azure Key Vault from Python script via 'os.environ["VAULT_URL]"...

I am having trouble accessing my Azure Key vault from my python script (debugging before deployment), the script cannot find the environment variable "VAULT_URL" even though I have set this in my...

View Article


JSON From HTTP Print Value With Python

Thank you in advance for your help - I have been searching for hours.Forgive me if I use the wrong terminology.I'm grabbing JSON from an http link. I can print the entire json string, and I can print...

View Article

alter session set CONTAINER with CX_Oracle

Now i use cx_oracle with python to execute oracle statements. I have oracle CDB and PDBs. I need to execute this statement from CDB to PDB (MYPDB)ALTER SESSION SET CONTAINER=MYPDB;SELECT (SELECT...

View Article


Is it possible to add a function to a class at init if function uses a class...

I have this script main.py:class Test: def __init__(self): self.arg = 'argg!!!' def meth_1(self , arg): print(arg + self.arg)a = Test()a.meth_1('po') # poargg!!!def meth_2(self, arg): print(3 * arg +...

View Article

Django Admin Import Error: NOT NULL Constraint Failed for ForeignKey Field in...

I'm experiencing a persistent issue with importing CSV data into my Django project using the django-import-export library in the admin panel. When trying to import records for a Copy model which has...

View Article


Scoping in Python 'for' loops

I'm not asking about Python's scoping rules; I understand generally how scoping works in Python for loops. My question is why the design decisions were made in this way. For example (no pun...

View Article

Function to determine if two numbers are nearly equal when rounded to n...

I have been asked to test a library provided by a 3rd party. The library is known to be accurate to n significant figures. Any less-significant errors can safely be ignored. I want to write a function...

View Article

Image may be NSFW.
Clik here to view.

Apply a color map / gradient map to an image using Python

Most image editing software has gradient map functions. Gradient maps take the brightness of a given pixel and apply a gradient of colors according to brightness. Photoshop and other software have ways...

View Article
Browsing all 23247 articles
Browse latest View live


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>