Skip to content

Tag: python

How to start a standalone cluster using pyspark?

I am using pyspark under ubuntu with python 2.7 I installed it using And trying to follow the instruction to setup spark cluster I can’t find the script start-master.sh I assume that it has to do with the fact that i installed pyspark and not regular spark I found here that i can connect a worker node t…

Convert datetime to time in python

I have: and then use: which gives me How do I just get: 10:30:00 as type datetime.time? Answer You can use the strftime method of the datetime object like this: More information here: https://docs.python.org/2/library/datetime.html#strftime-strptime-behavior Ok, I misunderstood. Use day.time() to get a time o…

Python: Maximum Subarray Sum

I’ve just tried to start learning Python today, so I am not knowledgeable when it comes to it’s functions. However, I found the maximum subarray problem, and wanted to try and solve it with the few, simple logical commands I have at my disposal. I have gotten stuck, and am almost certain the probl…

Jupyter – Split Classes in multiple Cells

I wonder if there is a possibility to split jupyter classes into different cells? Lets say: For more complex classes its really annoying to write them into one cell. I would like to put each method in a different cell. Someone made this this last year but i wonder if there is something build in so i dont need…