Skip to content

Comparison of file list with files in folder

I have a list of filenames but in the directory they are named a little different. I wanna print filenames that are not in directory. Example of files: FOO_BAR_524B_023D9B01_2021-157T05-34-31__00001_2021-08-30T124702.130.tgz I cannot get what I’m doing wrong… Answer The problem is that you iterate…

how to add a constant column to a dataframe without rows

I am trying to add a column with a constant value to a dataframe that does not have any rows. It appears this isn’t as easy as it would be if the rows were populated. How would one accomplish this? Should yield instead it yields Answer You can use .loc specifying the row index and column label, as follo…

For doesn’t restart on dataframe in python

i need do read the rows of a dataframe but it seems to stop at the first row. I also tried with iterrows but the results are similar. and the outpus is : so the for doesn’t iterate. I hope someone can help me, thank you so much. Answer You are performing inside the loop. This breaks the loop on

UPDATE SQLite database from Python not working as expected

I want to perform an UPDATE? on a SQLite database from Python (2.7). This is the table` and this is how I want to insert rows However, when I do a SELECT * FROM foo it the result set is zero rows.. There is not data in there. Why? Answer It sounds like you want to insert here, not update: