Category "python"

AttributeError: 'Index' object has no attribute 'tz_localize' with yfinance

'this error occurs only with some stocks, for instance with NFLX, KO or MCD, but not with AAPL or INFy both with yfinance 0.1.63 and 0.1.69, pandas 1.2.3 or 1.4

Download audio only youtube raises regexmatcherror

I am trying to execute the following code, that is supposed to download the audio file from youtube url from pathlib import Path from pytube import YouTube def

Fixing Traceback (most recent call last): in Bar code reader using Python

I used the following code to get the reading from a USB bar code reader connected to a raspberry pi. #!/usr/bin/python import sys def barcode_reader(): hi

Peak and Trough of Numeric Data

Can anyone help me please. I need to find the peak and troughs in a data series but with 2 conditions which are: Peak or trough is peak for minimum of n(days) L

how to change form field from dropdown list to radio button in django if the options in dropdown are being inherited from another model?

i am working on an application where i can select item from drop-down list and buy them. i have a form field which is a drop-down list(items are connected to ot

Spotify API get track_uri or track_id from own spotify data

[enter image description here][1]I have a dataframe that included my own data I've requested from Spotify (https://www.spotify.com/de/account/privacy/) Now, I h

Django many-to-many relations

I'm trying to create a web app in which users can participate in some groups (every user can be part of multiple groups), and I want to be able to make both que

Iterate Opening a List of URL's with Selenium

I am having trouble iterating the action of opening a list containing URLs using selenium. the issue is in the part labeled #Second Part in my code. linklinkfin

Running subprocess.Popen in a compiled script has a significant delay

Edit: In this specific example, Python 3.8 is being used on Windows 10. I need to run FFprobe through subprocess.Popen so I can capture and parse the output. If

Apply loc to the entire dataframe but one column (keep the one column as it was and not remove it)

I am trying to divide the entire dataframe by a fix number but I want to keep the 'Year' column as is. I tried dividing the entire df with 100 and then multiply

Authenticating other Users from my App - Tweepy

I've created an app in python to like tweets by hitting the POST endpoint -very simple. Next I'd like to have an account different than mine able to login and a

How to get Youtube channel's email using using Python, Javascript or an API

Does Youtube provides any API to get channel emails using Oauth? Or How can I get the email in About Section in the provided image using scraping with Python. A

Leverage not taken into account by Binance with CCXT in Python

I got a little problem with ccxt on Python. I'm (trying) to code a trading bot which takes my custom tradingview signal. So I've been tinkering a little test co

When I gave command on CMD manage.py runserver it instead took me into VS Code and when i ran it in VS code error was on (from django.core.management)

When I ran the command on CMD manage.py runserver it intern redirected to VS Code. When I tried to run on VS Code it showed the system cannot find the specified

Keras-tuning can't find callback

I am using keras-tuner in order to obtain the best set of hyperparameters for my model. I can reproduce my problem for a random dataset: def generate_data(n_win

Pandas - Cross referencing with DatetimeIndex - Groupby

I have data of many companies by month (End of Month). I want to create a new columns with groupby for each company where: new_col from Jul of this year to Jun

Delete all files without deleting folders

I have a folder named (top) with 10 folders named 1,2,3,4,5,6,7,8,9, and 10. Inside the top folder I have files, too (are not folders). I can list all the files

'conda init' without closing the current shell

There are a number of use cases for which I am trying to use conda . The main headache is that conda init just does not want to play fair within the flow of a

How do I get my FastAPI application's console log in JSON format with a different structure and different fields?

I have a FastAPI application where I would like to get the default logs written to the STDOUT with the following data in JSON format: App logs should look like

How to trigger AWS lambda functions manually which is already scheduled using event bridge rules

I am using event bridge to trigger a lambda function at 8 everyday to perform some ETL operations. At times i receive requests to trigger the lambda manually on