Comments (5)
You can use the @tee
macro from the Queryverse.jl package for this:
result = df |> @map({e = _.a^2}) |> DataFrame |> @tee(save("tmp.csv"))
from csvfiles.jl.
That's a nice macro. Thank you.
from csvfiles.jl.
I wish we had proper syntax for this in julia for this: JuliaLang/julia#25233
from csvfiles.jl.
I also had a quick look through the docs for a tee
function or something of the like. Unfortunately, I didn't find any such thing. It'd be great if something of the sort were in Base
.
from csvfiles.jl.
I think this may be a possible variant of your @tee.
function tee(func::Function)
data -> (data |> func; data)
end
Which can be more compactly expressed without the pipe operator.
tee(func::Function) = data -> (func(data); data)
The resulting tee
function use is then.
result = df |> @map({e = _.a^2}) |> DataFrame |> tee(save("tmp.csv"))
from csvfiles.jl.
Related Issues (20)
- Error loading csv file with moderate length string HOT 1
- Loading a CSV file results in MethodError: no method matching pointer HOT 1
- How to load a file in CSV format but the extension isn't CSV? HOT 1
- The streaming load/save example does not work HOT 3
- Add example of how to read CSV files and specify a delimiter HOT 6
- Extending non-method-owning module
- Load first N rows of a file HOT 1
- Typo in README.md
- NO applicable_loaders found for csv HOT 1
- File reading time HOT 3
- How do I iterate through each column? HOT 1
- TypeError: non-boolean (Missing) used in boolean context HOT 4
- Deprecation warning at TableTraitsUtils.jl:17 HOT 1
- MethodError: no method matching iterate(::CSVFiles.CSVFile)
- CSV file load error - no method matching UInt8(::String) HOT 3
- julia version bug in 1.5? HOT 1
- `load()` doesn't support URLs HOT 2
- TagBot trigger issue HOT 2
- BUG: importing csv file when bottom right cell is empty
- Add support for DAT files
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from csvfiles.jl.