Welcome to Software Development on Codidact!
Will you help us build our independent community of developers helping developers? We're small and trying to grow. We welcome questions about all aspects of software development, from design to code to QA and more. Got questions? Got answers? Got code you'd like someone to review? Please join us.
Activity for congusbongusâ€
Type | On... | Excerpt | Status | Date |
---|---|---|---|---|
Comment | Post #291898 |
I don't think it's necessarily those two questions, since there are alternate solutions that don't involve a self-join and sum (for example, 2 nested for loops, although possibly less efficient, would be a solution too). (more) |
— | 4 months ago |
Comment | Post #291912 |
I assume you are interested in pyspark, the python bindings, but there are multiple languages for interacting with spark, most of which have docker images that you can run. See https://spark.apache.org/ which has simple commands to get started. (more) |
— | 4 months ago |
Edit | Post #291914 | Initial revision | — | 4 months ago |
Answer | — |
A: Run Spark code without Spark? As of version 2.2, installing pyspark will also install spark, so you can run `pip install pyspark` or equivalent and use it in your normal python environment. The pyspark getting started docs also include some links to live notebooks, however as of writing they seem to be unavailable. (more) |
— | 4 months ago |
Comment | Post #291898 |
Alas in the other comment thread, it shows that this question is prone to being misinterpreted, so please edit if this question can be improved. I have attempted to make this question clear by showing a concrete example, expected result, and an example of an incorrect attempt. If there is some way to... (more) |
— | 4 months ago |
Comment | Post #291898 |
you have misinterpreted the question; the condition for the cumsum involves different rows for "value" and "threshold", therefore the filter and cumsum cannot be split into two parts, as it would lead to the incorrect result of "3, 4, 6" instead of "3, 1, 3" as expected. Further, and this may not hav... (more) |
— | 4 months ago |
Edit | Post #291905 | Initial revision | — | 4 months ago |
Answer | — |
A: How to get conditional running cumulative sum based on current row and previous rows? - Use a `collectlist` collecting the values from all preceding rows up to the current row into a struct - Then `filter` on that struct based on its value and the current row's threshold - Use `aggregate` to calculate the result based on adding the struct's `acc` field Note that doing so may reor... (more) |
— | 4 months ago |
Edit | Post #291898 | Initial revision | — | 4 months ago |
Question | — |
How to get conditional running cumulative sum based on current row and previous rows? How do I perform a running cumulative sum that is based on a condition involving the current row and previous rows? Given the following table: ``` acc | value | threshold 3 | 1 | 1 1 | 2 | 2 2 | 3 | 2 ``` I would like to find the cumulative sum of `acc` if `value >= th... (more) |
— | 4 months ago |
Edit | Post #291806 |
Post edited: |
— | 5 months ago |
Edit | Post #291806 | Initial revision | — | 5 months ago |
Answer | — |
A: What's the difference between include_directories and target_include_directories? `includedirectories` works on all targets in the current `CMakeLists.txt` file, whereas `targetincludedirectories` only adds them for the specified target. `includedirectories` is fine to use for simple projects, but `targetincludedirectories` is better for more complex ones because it is more exp... (more) |
— | 5 months ago |
Edit | Post #291602 | Initial revision | — | 5 months ago |
Answer | — |
A: How do I trim a sorted list in Python? You can use the functions in the `bisect` module with a list slicing operator. For example `bisectleft` finds the index of the insertion point in a sorted list, and if the values are equal, it will find the position to its left. ``` >>> l = [1, 3, 5, 6, 7, 8] >>> from bisect import bisectleft >... (more) |
— | 5 months ago |
Edit | Post #291601 | Initial revision | — | 5 months ago |
Question | — |
How do I trim a sorted list in Python? How do I trim a sorted list in Python, so that I only keep the elements greater than a certain value? For example, if I have this list: `l = [1, 3, 5, 6, 7, 8]` How can I efficiently get a list of numbers greater than 4? (more) |
— | 5 months ago |
Edit | Post #291439 | Initial revision | — | 6 months ago |
Answer | — |
A: How do I concatenate two animated gifs together? You can use imagemagick. Suppose you have the files `a.gif` and `b.gif` and want to play a and then b. Then use the command: ``` convert a.gif b.gif out.gif ``` And your results will be written to `out.gif`. You can also repeat the arguments if you want to play one of the files multiple times... (more) |
— | 6 months ago |
Edit | Post #291438 | Initial revision | — | 6 months ago |
Question | — |
How do I concatenate two animated gifs together? How do I concatenate two animated gifs together? The gifs are identical in dimensions and I would like to stitch them together so they play one after the other. (more) |
— | 6 months ago |