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:
filter = df["content"]
|> S.to_list()
|> Enum.map(&Regex.match?(tags,&1))
|> S.from_list()
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?
Update:
post_filter = df["content"]
|> S.downcase()
|> S.to_list()
|> Enum.map(&Regex.match?(tags,&1))
|> Enum.with_index()
|> Enum.filter(&(elem(&1, 0) == true))
|> Enum.map(&(elem(&1, 1)))
Can be used as input for the slicing…






















