Skip to content

xh2/data-pipeline

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

18 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Build Status

data-pipeline

Minimum viable DataFrame pipeline.

Usage

df = pd.DataFrame({'a': [1, 2, 3, 4, -1]})
pipeline = Pipeline([__LogShape('Initial shape:'),
                     TransformCol('a', lambda x: x * 2),
                     ExprAssign('b', 'a+1'),
                     ExprAssign('a', 'a-1'),
                     Filter('b', lambda x: x > 5),
                     __LogShape('After filtering for b:'),
                     ResetIndex(),
                     __Log('Done.')
                     ])
pipeline.apply(df)

Results in:

Initial shape: (5, 1)
After filtering for b: (2, 2)
Done.
   a  b
0  5  7
1  7  9

Available Stages

TransformCol
ExprAssign
Filter
ResetIndex
DropCols
RenameCols
ReorderCols
QuickEval
__LogShape
__Log

About

Minimum viable DataFrame pipeline.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages