Skip to content

Tag: python

Loop through variable in python

Please forgive me… new to python and first question on stack. I’m trying to accomplish two things with while loop: increment round number (i’m doing this successfully) have the loop iterate over my variable “fruits” to print the first fruit on round one and second fruit on round …

Numpy Delete not deleting rows

I’ve been trying to write some code to delete rows from my 2d array according to the following criteria: every lone entry, so that no patient only has one entry (the mriindex ticks up by 1 for every entry of the same patient in the array) every entry above the 4th one. Should either of those criteria be…

How to resolve the Error in anaconda start up?

Few days ago, Anaconda Navigator used to work fine but now it won’t open; I’ve even reinstalled the navigator but still getting the same issue. Here is the error message Navigator Error: Main Error Traceback Answer According to github the problem lies with “config.yaml” file in C:Users…

Updating values within python column based on date

I have a dataset where I would like to replace and update values within a column when a data condition is met. Data Desired Doing Still researching, any suggestion is appreciated- Perhaps I need to convert quarters to datetime longdate and base the condition off of this column. Answer here is one way to do it…

Regex: searching for words that starts with @ or @

I want to create a regex in python that find words that start with @ or @. I have created the following regex, but the output contains one extra space in each string as you can see However, the output that I want to have is the following I would be grateful if you could help me! Edit: @The fourth