Category "python"

Tkinter unable to configure

I have this problem when I try to run an app that imports turtle: Traceback (most recent call last): File "/home/panos/Documents/python/challenge_60.py", line

How to check if there's a tuple inside a list?

Why does this: seq = [(1, 2), (3, 4), (5, 6)] print(() in seq) return False? How can I check if there's a tuple, or even a generic sequence, inside a sequenc

How can I compare the contents of two text files in python

Hello i need to write a script like a wrote in title so i want to give an example for what i want : file1.txt's content: New York Los Angeles Miami file2.txt's

Subprocess loop in python

I have a folder with a few hundred .bed files that I want to loop over to extract fasta sequences. In the terminal, my command is: twoBitToFa -bed=PA2_03_2bit.b

What's the computational complexity of .iloc[] in pandas dataframes?

I'm trying to understand what's the execution complexity of the iloc function in pandas. I read the following Stack Exchange thread (Pandas DataFrame search is

Group By and Sort a Tensorflow Dataset

I would like to group rows in a tensorflow dataset by a key and select top k rows in each group by some value. This is easily doable ex. in Pandas or SQL, but n

"SpecNotFound: Invalid name, try the format: user/package" in Creating new Conda env with yml file (Windows 10)

I'm trying to Create New conda environment by 'Anaconda Prompt' usnig yml File in Windows 10. So here is the steps i made through: 1. using cd command i changed

Email Verification using re.search Python

Need help making email verifications with the variable 'pattern' and making it so that it loops if it doesn't contain whatever is within the pattern. Required t

Unicode string cannot be passed to SQL query in form of parameter with pymssql

I'm having trouble passing a Unicode string to an SQL query via parameter. Initiate the connection and execute the query: conn = pymssql.connect(server='serverN

"SpecNotFound: Invalid name, try the format: user/package" in Creating new Conda env with yml file (Windows 10)

I'm trying to Create New conda environment by 'Anaconda Prompt' usnig yml File in Windows 10. So here is the steps i made through: 1. using cd command i changed

tensorflow load data: bad marshal data

I want to load FaceNet in Keras but I am getting errors. the modal facenet_keras.h5 is ready but I can't load it. you can get facenet_keras.h5 from this link: h

How do I force a blank for rows in a dataframe that have any str or character apart from numerics?

I have a datframe >temp Age Rank PhoneNumber State City 10 1 99-22344-1 Ga abc 15 12 No Ma xyz For the column(Phone Numbe

mount_workspace_dir notebook magic not working in EMR Studio

In an EMR Studio Python3 notebook, I execute the following: %mount_workspace_dir . And receive the following error: UsageError: Line magic function `%mount_wor

Calculating Mean Squared Error with Sample Mean

I was given this assignment, and I'm not sure if i understand the question correctly. We considered the sample-mean estimator for the distribution mean. Anothe

Pytorch RuntimeError: CUDA out of memory with a huge amount of free memory

While training the model, I encountered the following problem: RuntimeError: CUDA out of memory. Tried to allocate 304.00 MiB (GPU 0; 8.00 GiB total capacity; 1

Find most elegant way to return key if condition is set to true

I have a python dictionary slot_a = 'a' slot_b = 'b' # dict which lists all possible conditions con_dict = {"branch_1": slot_a == 'a' and slot_b == 'b',

How to use DeepFace.detectFace() to actually detect a face in an image?

I am trying to identify and count the number of human faces in a every picture of a folder full of pictures, I am using Deepface to get the job done. I have onl

How to make this code faster in python (algorithm question)

Today I was browsing for some questions that I saw this: Algorithm - Air Battle C ++ time limit: 1 second Java time limit: 2 seconds Python time limit: 10 secon

Python pyaudio error while recording from microphone

I was trying to convert speech to text via pyaduio.The program was working fine for a few hours but suddenly my visual studio 2019 keeps on marking an error in

how can reslove : InvalidArgumentError: Graph execution error?

Hello guys i am a biggner at computer vision and classification, i am trying to train a model using cnn method with tensorflow and keras, but i keep getting the