Compared to Pythons pandas I am missing some functions for DataFrames and Series from Explorer, or I have to apply a workaround, which makes everything less expressive.
DataFrames have a drop_nil function. Why don’t have Series have it? Well, I can convert it to list, drop them from the list and then convert back…
By the documentation the series have a contains function, that use a regex, could not get with working with a compiled regex string. I did a mapping instead:
This returns a series of boolean. But I can not use it filter a DataFrame or a Series? At least I did not find it in the reference and also no way around. It neighter a filter, filter_with nor a slice. Slice needs indices. How do I get the indices, where the value is :true?
The last question is, about Date(time) columns. How can I convert a Date to a calendar week?
Thanks. @billylanchantin the mask function helped alot. Sorry, that I was not able find it.
The calendar week is somewhat more complex, because it first week of the year, might partly be counted as the last week of the year before. I had to look it up. Normally I would expect it to be a part of the date(time) library
Sorry for answering late. The messages from the elixir-forum always end up in my spam filter. About the PR… a) a I very new to Elixir not so bold to mess up some core libraries . Also barely have to time.
Since you’re new to Elixir, you can get the latest ref by adding the following to your project’s mix.exs:
# list of deps
[
# ...
{:explorer,
git: "https://github.com/elixir-explorer/explorer.git",
# This is the current ref of main.
# It may change, but as long as the ref is after this one,
# you'll have access to the function.
ref: "aef274989ab490b0a392ccd19ec24b286a8cda1c",
override: true},
# ...
]
There are other ways of doing this too, but that should get you started.
Thanks for your reply. @josevalim Works with installing rustup. The asdf plugin for rust I found has no nightly rust?!
Compiling takes a while. During compilation the explorer version was denoted as 0.1. How do I check that?