Category "python"

AttributeError: 'TimedeltaProperties' object has no attribute 'minute'

I have a dataframe that looks like this df [output]: date time 2020-02-28 00:30:45 2020-02-28 00:30:45 2020-03-09 00:21:06 2020-03-09 00:21:06 2020-

efficient way of computing a list with mean of values in another list

I need to compute a list with the mean values of another list. To be more precise, the input list have this form: input_list = ['1.538075/42.507325', '1.53796

FastAPI variable query parameters

I am writing a Fast API server that accepts requests, checks if users are authorized and then redirects them to another URL if successful. I need to carry over

How to install jupyter lab on linux mint?

I have installed pip3 by sudo apt install python3-pip And then pip3 install jupyterlab During installation errors: ERROR: jupyterlab-pygments 0.1.2 has require

python import socket class from other modules

I have created a class(object) connection_manager using socket TCP in a module (connection.py): #file connection.py HOST = "127.0.0.1" # Standard loopback inte

Python: Multiple "or" Statements [duplicate]

I'm working on building a snake clone using Turtle. Is there a cleaner/more pythonic way to write the conditional inside of this function?

Weird Python Log Error while trying to reinstall Python on Windows 11

I installed Python on Windows 11 normally after getting the setup from python.org but, by mistake, I deleted the partition Python was installed in (it was E dri

Apply Tensorflow tf.keras.initializers.GlorotNormal(seed=1) to tf.Variable

How to apply the initializer to the tf.Variable function? Am I on the right track? def initialize_parameters(): initializer

I want to get the address from mnemonic with the proper derivation path

I am very new to blockchain programming and programming in general. I want to generate my SOL address using the mnemonic seed phrase with the derivation path "m

WARNING: autodoc: failed to import module 'upload_data_to_server' from module 'manual';

I'm trying to document a Django project using Sphinx's autodoc extension. I have two main problems: It's documenting excessivelly in some modules (importing doc

Exception has occured: WebDriverException // Session deleted because of page crash

while I was able to get help on another issue with a python-based web scraper, another issue comes up when I run the code. Page crash Can someone tell me why it

Python Ftplib does not upload files

I am creating a program that generates xml and uploads them to an ftp server but I have encountered an error when uploading the file the program freezes for 3-4

Use a Python f-string to build an SQL query 'IN' clause

I'm trying to use an f-string in Python to build my SQL query. The query below seems fine: code = ('123', '234') print(f"select * from tbl where code in {code}

Failed to import Cloud Firestore library for Python

I am trying to create a python script to fetch data from my Cloud Firestore database. But I get this weird error: import firebase_admin from firebase_admin impo

How to generate Pydantic model for multiple different objects

I need to have a variable covars that contains an unknown number of entries, where each entry is one of three different custom Pydantic models. In this case, ea

Reshape tensorflow tensors from feature columns into training samples

Currently my dataset looks like: feat_1 = tf.random.uniform( shape=[8000,1], minval=0, maxval=1, dtype=tf.dtypes.float32, seed=1123, nam

List of chooses depending on user permissions

I'm building simple app on streamlit. I'm struggling with making list of chooses depending on user permissions. utils.py Dict with pages: pages = { "Start":

Python fuzzy matches of elements from two lists of song titles

I have two lists of titles for jazz standards. Both lists have a couple thousand entries, and I would like to find the songs in the second list that are not co

Python fuzzy matches of elements from two lists of song titles

I have two lists of titles for jazz standards. Both lists have a couple thousand entries, and I would like to find the songs in the second list that are not co

How to get the listed NFT of a collection on OPENSEA

Hey Im trying to get the listed nfts of a collection on opensea but its not working im using the API but for some reason all im getting a cloudflare block is th