Skip to content

Replace rows with different number of characters

I have a column having strings of different number of characters. Most of rows have the following number of characters: but there are also rows having different number, for instance I would like to replace those columns that have a number of characters different from xx.xx.xxxx xx-xx-xx with a null value (e.g…

Finding the max element in a List

I have to find the max element in a list while filtering out all of the items inside of it that aren’t an integer or a float. So far I have this code and it seems to work except when giving the list [1, ]. I get an error saying that the list is empty and I can’t find the

Using Python writerows with list of lists error

I’m trying to write a csv file using pythons CSV library. So here’s my actual code: However I get this error when I run it: Traceback (most recent call last): File “”, line 1, in File “/home/jean/dev/myproj/myproj/utils.py”, line 130, in test_mail writer.writerows(csv_list[…

Run python command inside a bash script and get the result

I would like to run a python command that return true or false inside a bash script: The code above is just to sketch the idea. I need boolean to be false or true (bash boolean values) depending on the result of …operations…. The code above is not working: boolean results to be an empty variable. …