Skip to content

Tag: python

Changing column various string formats in pandas

I have been working on a dataframe where one of the column (flight_time) contains flight duration, all of the strings are in 3 different formats for example: “07 h 05 m” “13h 55m” “2h 23m” I would like to change them all to HH:MM format and finally change the data type from…

How can I return a sorted list of integers here? [closed]

Closed. This question needs details or clarity. It is not currently accepting answers. Want to improve this question? Add details and clarify the problem by editing this post. Closed 12 months ago. Improve this question My problem is on the last line. In the last line, I wanted to return 4, 8, 9, 10 but it&#8…

name ‘Bidirectional’ is not defined

Im following this tutorial and right when I want to initialize a sequential keras, like the code below: I get an error saying : What is the problem ? it is the exact same code as in the tutorial. Answer You’re most likely missing the import statement from the tensorflow package. It appears that’s there is a l…

Kernel dies when processing DataFrame

I’ve been able to get this to execute once but since then the kernel just hangs and then dies. Any help would be appreciated. [Dataframe head] Answer You might want to consider using .apply() function from pandas directly with a custom function or a lambda expression. Something like this I do not see an…

Pandasql Exception with OVER

I tried to use this line of code : NB : delete ‘locals()’ or replace by ‘globals()’ don’t solve the problem. But I have this error : http://sqlalche.me/e/14/e3q8 (Same error with Average) I load my dataframe like this : My file is in the same directory as my Jupiter notebook file…