Skip to content

Instantly share code, notes, and snippets.

View kotarot's full-sized avatar

Kotaro Terada kotarot

View GitHub Profile
index datetime Pressure Sea-Level Pressure Precipitation Temperature Relative Humidity Sunlight Hours Day/Night
0 2020-10-01 00:10:00 1006.5 1009.3 19.6 82 Night
1 2020-10-01 00:20:00 1006.6 1009.4 19.5 82 Night
2 2020-10-01 00:30:00 1006.7 1009.5 19.6 81 Night
3 2020-10-01 00:40:00 1006.9 1009.7 19.6 82 Night
4 2020-10-01 00:50:00 1006.9 1009.7 19.7 82 Night
5 2020-10-01 01:00:00 1007.1 1009.9 19.5 83 Night
6 2020-10-01 01:10:00 1007.0 1009.8 19.5 83 Night
7 2020-10-01 01:20:00 1006.7 1009.5 19.2 84 Night
8 2020-10-01 01:30:00 1006.7 1009.5 19.2 84 Night
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
import apache_beam as beam
from apache_beam.testing.test_stream import TestStream
from apache_beam.transforms.userstate import CombiningValueStateSpec
from apache_beam.transforms.window import TimestampedValue
# Stateful DoFn, based on:
# - https://beam.apache.org/blog/stateful-processing/
# - https://github.com/apache/beam/blob/30f9a607509940f78459e4fba847617399780246/sdks/python/apache_beam/transforms/userstate_test.py
class IndexAssigningStatefulDoFn(beam.DoFn):
@kotarot
kotarot / rectangle-packing-problem-input-and-output.md
Last active February 8, 2022 12:53
rectangle-packing-problem-input-and-output

rectangle-packing-problem-input-and-output