Update README.md
Browse files
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.
|