IlyaGusev commited on
Commit
7079858
·
1 Parent(s): 8654ee2

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +12 -0
README.md CHANGED
@@ -157,6 +157,18 @@ for example in dataset:
157
  }
158
  ```
159
 
 
 
 
 
 
 
 
 
 
 
 
 
160
  ## Source Data
161
 
162
  * The data source is the [Russian StackOverflow](https://ru.stackoverflow.com/) website.
 
157
  }
158
  ```
159
 
160
+ You can use this little helper to unflatten sequences:
161
+ ```python
162
+ def revert_flattening(records):
163
+ fixed_records = []
164
+ for key, values in records.items():
165
+ if not fixed_records:
166
+ fixed_records = [{} for _ in range(len(values))]
167
+ for i, value in enumerate(values):
168
+ fixed_records[i][key] = value
169
+ return fixed_records
170
+ ```
171
+
172
  ## Source Data
173
 
174
  * The data source is the [Russian StackOverflow](https://ru.stackoverflow.com/) website.