Skip to content
Advertisement

Using Functions rather than one liners Python

I am trying to use Python functions to perform data preprocessing. I want to have efficient code. I have like 8 files that I am reading to load them and do some sort of analysis. How would one achieve that using a function and the .head() to read all the CSV files?

For instance instance I have loaded my data from One drive as follows.

JavaScript

How would I write a .head() to inspect the top 5 rows of all the loaded files?

Advertisement

Answer

list or map comprehension would be better imo

JavaScript
User contributions licensed under: CC BY-SA
1 People found this is helpful
Advertisement