Skip to content

Tag: list

Path inside the dictionary from the variable

I have a code: Now I have an error: But if I try: Everything is okay. How I should send the path to the list from the JSON’s dictionary — from one function to other? Answer You cannot pass language syntax elements as if they were data strings. Similarly, you could not pass the string “2 > 1 and…

Histogram of lists enteries

I have a number of lists as follows: I wish to generate a histogram based on the labels, ignoring the numbering, that is, a has 4 entries over all the lists, ba 1 entry, u has 1 entry, and so on. The labels, are file names from a specific folder, before adding the numbers, so it is a finite known

How to delete duplicates pandas

I need to check if there are some duplicates value in one column of a dataframe using Pandas and, if there is any duplicate, delete the entire row. I need to check just the first column. Example: What i need is: I can delete the ‘object’ duplicates with the following code, but I can’t delete…

Iterating through two lists and return indices

I created a habit tracker app and one of the functions is to return the longest uninterrupted streak of done habits. If there are two or more habits with the same streak length, I want to return all of them. Therefore I saved the habit IDs in an id_list and the respective streak lengths in the streak_length_l…