[transform_filter] - condition not working
See original GitHub issueI do not understand why the condition in transform_filter is not working and have not found any explanation around (including documentation).
-
The problem seems to be in FilterTransoform method.
-
another issue: where and how am I supposed to put/write the ‘background’ to change the default transparent?
import altair.vegalite.v2 as alt
import pandas as pd
stocks = pd.read_csv(data.stocks.url)
type(stocks)
stocks.head()
stocks.symbol
stocks['symbol'] = stocks['symbol'].astype('category') # forced to be a factor
stocks.symbol
base = alt.Chart(stocks).encode(
x='date:T',
y='price:Q',
color='symbol:N'
).transform_filter(
stocks.symbol == 'GOOG' # problem is here
)
base.mark_line()
Issue Analytics
- State:
- Created 5 years ago
- Comments:11 (7 by maintainers)
Top Results From Across the Web
Can't get transform_filter to work in Altair - Stack Overflow
I getting the separate charts (bar and rule to work) was easy, but I run into issues in making mark_rule interactive. import altair...
Read more >Filter Transform — Altair 4.2.0 documentation
The filter transform removes objects from a data stream based on a provided filter expression, selection, or other filter predicate. A filter can...
Read more >Linkify.TransformFilter - Android Developers
Driver. On this page; Summary. Public methods. Public methods ... TransformFilter enables client code to have more control over how matched patterns are ......
Read more >Domain Transform Filter and Spatial-Aware Collaborative ...
To overcome this problem, a classification method (DF+SACR) that includes domain transform filter (DF) and spatial-aware CR (SACR) is ...
Read more >5. Filtering Data - ParaView Documentation
If a menu item is disabled, it implies that the active source does not produce data ... 5.11 The Transform filter showing the...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Another thing (I should really read questions more carefully before answering 😄)
You’re rendering your plot with Vega-Lite version 1; this doesn’t support everything that Altair version 2 supports, and so filter transforms, background configurations, etc. will not always work properly, and some specifications will simply fail to produce a chart at all.
nteract does not support Vega-Lite 2 yet, and so I would not recommend it as a frontend for Altair at this time. You might try JupyterLab, Jupyter Notebook, or CoLab, until the nteract project updates its dependencies.
Oh, noticed your other question about backgrounds. If you want to configure the background, you can use:
The background is transparent by default, as mentioned here: https://vega.github.io/vega-lite/docs/config.html#top-level-config