altair

Altair: Can't get independent 'y' scales with faceted heatmap

蓝咒 提交于 2021-01-05 06:15:17
问题 I'm working in a jupyter notebook trying to display a sort of adjacency-matrix-like data set in a grouped layout like this one using Altair's Chart.facet() method. This guy's answer gets me halfway there, but when I try to facet with rows and resolve the y scale as 'independent', the chart comes up as a tiny box containing no elements. df = (pd.util.testing.makeDataFrame() .reset_index(drop=True) # drop string index .reset_index() # add an index column .melt(id_vars=['index'], var_name=

Altair - Unable to get tooltips for one layer in a line chart

老子叫甜甜 提交于 2021-01-04 06:26:10
问题 When I plot a layered chart consisting of two groups of lines, the tooltips in one layer do not show up. This also occurs in the VL editor. Any insight to why this is happening would be much appreciated. Here is a reproducible example to demonstrate the issue (in reality I have more lines in the first layer): Altair version 4.0.0 df=pd.DataFrame({'school_code': ['AQUI', 'Board'] * 5, 'y4_rate': [.1, .2, .3, .4, .5, .1, .2, .3, .4, .5], 'cohort_year': ['1', '1', '2', '2','3', '3', '4', '4', '5

Making a legend into multiple columns in Altair

有些话、适合烂在心里 提交于 2020-12-06 03:56:11
问题 Apologies for not being able to provide a lot of code, everything is interconnected and it's not possible right now. My issue is I created a point chart that serves as an "interactive legend". legend = alt.Chart(source).mark_point().encode( y=alt.Y('STATE', axis=alt.Axis(orient='right')), ).add_selection( select_state ) The problem is that 50 states are listed. As a result the chart becomes very long and prevents everything from fitting on a single screen. Is there any way to somehow wrap

micro:bit CPU 第二版

不打扰是莪最后的温柔 提交于 2020-11-09 04:14:09
翻译自:http://www.suppertime.co.uk/blogmywiki/2020/06/improved-microbit-cpu/ 在第一版的micro:bit CPU中(用MakeCode编程),只有非常精简的4条指令,但它在许多方面都像第一代家用计算机中使用的微处理器,如Altair 8800、Commodore Kim-1和剑桥科学的MK14: 没有使用诸如MakeCode,Scratch,Python或BASIC之类的高级语言进行编程,而是使用二进制代码指令。 每个二进制代码代表一条指令,一条附加了数据的指令,或者仅仅是数据。 程序运行时,CPU 依次从内存中提取每个指令。 然后解析指令 CPU 执行该指令 使用程序步数计数器跟踪其在程序中的位置,并在每次需要获取新指令时在程序计数器中加1。 不断从内存中按顺序提取,解码和执行指令,直到到达暂停指令为止。 实际上,我们的简易CPU所能做的就是将两个数字加在一起,并使用LED以二进制形式显示答案。它只不过是一个计算器而已,但不是一个好的计算器,因为它不能减、乘或除。 因为设计指令的方式,它仅限于4条指令: 指令限制为5位二进制数,而不是早期计算机系统中通常使用的8位二进制,因为我希望能够在micro:bit的LED显示屏的一行上显示指令的内容,发光的LED代表1,不发光的LED代表0。 操作数(数据