Skip to content

Commit ddca570

Browse files
committed
WIP, Example for changing data
1 parent 243cd9f commit ddca570

File tree

1 file changed

+19
-2
lines changed

1 file changed

+19
-2
lines changed

content/work-with-data.rst

Lines changed: 19 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -302,8 +302,25 @@ Exercise
302302
to understand the model.
303303

304304

305-
Convert untidy data into tidy data with Pandas
306-
----------------------------------------------
305+
Efficient use of untidy data
306+
----------------------------
307+
308+
Many data analysis tools (like Pandas) require tidy data, but some data is not in a suitable format.
309+
What we have seen often in the past is people then not using the powerful tools, but write comple scripts that
310+
extract individual pieces from the data each time they need to do a calculation.
311+
312+
Example of "questionable pipeline":
313+
length_array = []
314+
315+
for entry in data:
316+
length_array.append(len(entry['length']))
317+
...
318+
319+
320+
321+
322+
Example of pipeline with initial conversion to pandas e.g. via json_normalize
323+
307324

308325

309326

0 commit comments

Comments
 (0)