Skip to content

Eternalon03/csv-editor

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 

Repository files navigation

csv-editor

What I learnt doing this project

Pandas is built upon NumPY, needs NumPY to run

Vectorization: replacing explicit loops with array expressions, one or two orders of magnitude faster NumPy delegates the looping from array expressions internally to optimized C and Fortran functions, since python is slow

for-loop

def count_transitions(x) -> int:
    count = 0
    for i, j in zip(x[:-1], x[1:]):
        if j and not i:
            count += 1
    return count

vectorization

np.count_nonzero(x[:-1] < x[1:])

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published