我在R中有以下data.frame:
> daily
DoW Duration
1 Friday 14.0000000000000
2 Monday 21.0000000000000
3 Saturday 12.0000000000000
4 Thursday 28.0000000000000
5 Tuesday 12.0000000000000
6 Wednesday 91.0000000000000
7 Sunday 20.0000000000000
Run Code Online (Sandbox Code Playgroud)
我想更改因子级别的顺序,以便周数符合(美国)星期几的顺序.
看起来我可以用一种缓慢而令人费解的方式做到这一点relevel().但这只需要1个数字参数并将其移至顶部.所以,relevel(daily$DoW, 7)将星期日移到顶部,但其余的仍然是无序的(这意味着我需要以相反的顺序重新排列).
可行,但必须有更好的方法,对吧?
(时间序列解决方案也可以接受.)
我的模板中有以下代码:
data: [{% for deet in deets %} {{ deet.value*100|round(1) }}{% if not loop.last %},{% endif %} {% endfor %}]
Run Code Online (Sandbox Code Playgroud)
我期待数据四舍五入到小数点后1位.但是,当我查看页面或源时,这是我得到的输出:
data: [ 44.2765833818, 44.2765833818, 44.2765833818, 44.2765833818, 44.2765833818, 44.2765833818, 44.2765833818, 44.2765833818, 44.2765833818, 44.2765833818 ]
Run Code Online (Sandbox Code Playgroud)
这不会四舍五入到小数点后1位.它运行没有模板错误或任何东西,但产生不正确的输出.我对文档的理解,甚至是相关的堆栈溢出问题,都是我的格式应该有效.我错过了什么或做错了什么?
我正在尝试.gitignore emacs临时/自动保存文件.我正在使用...
\.\#.*
Run Code Online (Sandbox Code Playgroud)
在我的.gitignore中.
但是git add -A在子文件夹中运行仍然给了我:
# new file: .#make_collections.py
# new file: .#norm_collections.py
# new file: make_collections.py
# new file: norm_collections.py
Run Code Online (Sandbox Code Playgroud)
即使
\.\#.*
Run Code Online (Sandbox Code Playgroud)
当我用正则表达式测试器测试它时,显然得到了正确的文件名,而不是错误的文件名.
我的列表看起来像这样:
* TODAY
** TODO Item 1
** TODO Item 2
* TOMORROW
** TODO Item 3
** TODO Item 4
Run Code Online (Sandbox Code Playgroud)
......作为一个单一的列表,基于我在这里收到的一些建议.我想将TODO Item 2从TODAY下移到TOMORROW下.
手册说:
M-up
M-down
Move the item including subitems up/down (swap with previous/next item of same indentation). If the list is ordered, renumbering is automatic.
Run Code Online (Sandbox Code Playgroud)
但是当我可以改变第1项和第2项的位置时,我无法将第2项移到今日标题之外 - 我无法在明天的标题下将其移动到第3项之前.缓冲区告诉我:
cannot move past superior level or buffer limit org mode
什么是击键让我将子项目"超越上级"移到新标题下?
尝试按照这里的说明安装pyaudio :
$ git clone http://people.csail.mit.edu/hubert/git/pyaudio.git
$ cd pyaudio
$ sudo python setup.py install
running install
running build
running build_py
running build_ext
building '_portaudio' extension
gcc -pthread -fno-strict-aliasing -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fPIC -I/usr/include/python2.7 -c src/_portaudiomodule.c -o build/temp.linux-x86_64-2.7/src/_portaudiomodule.o
In file included from /usr/include/python2.7/Python.h:8:0,
from src/_portaudiomodule.c:28:
/usr/include/python2.7/pyconfig.h:1161:0: warning: "_POSIX_C_SOURCE" redefined [enabled by default]
/usr/include/features.h:215:0: note: this is the location of the previous definition
src/_portaudiomodule.c:29:23: fatal error: portaudio.h: No such file or directory
compilation terminated.
error: command 'gcc' …Run Code Online (Sandbox Code Playgroud) 我正在关注这本kivy书,虽然我可以理解如何更改按钮的背景颜色,但我还没有找到关键字来更改文本颜色.
#!/usr/bin/kivy
import kivy
kivy.require('1.7.2')
from random import random
from kivy.app import App
from kivy.uix.widget import Widget
from kivy.uix.gridlayout import GridLayout
from kivy.graphics import Color, Ellipse, Rectangle
class MinimalApp(App):
title = 'My App'
def build(self):
root = RootLayout()
return(root)
class RootLayout(GridLayout):
pass
if __name__ == '__main__':
MinimalApp().run()
Run Code Online (Sandbox Code Playgroud)
#:kivy 1.7.2
#:import kivy kivy
<RootLayout>:
rows: 1
Label:
text: "Why does this not work?"
# rgba: 1,0,1,1 # doesn't work
# Color: # doesn't …Run Code Online (Sandbox Code Playgroud) 我在跑:
我看了看:
虽然上面的要点看起来很有希望,但我还没有找到任何看起来像权威的方式来运行org-haskell(例如,没有关于melpa的东西),当然没有什么专门针对运行堆栈环境而不是使用我的任何复杂性全球ghc将需要.
当我尝试:
#+BEGIN_SRC haskell
let x = "test"
putStrLn x
#+END_SRC
Run Code Online (Sandbox Code Playgroud)
我明白了
执行Haskell代码块
......永远挂起.当我Cg,我看到:
GHCi, version 7.6.3: http://www.haskell.org/ghc/ :? for help
Loading package ghc-prim ... linking ... done.
Loading package integer-gmp ... linking ... done.
Loading package base ... linking ... done.
Some flags have not been recognized: prompt2, ghci |
ghci ?> let x = "TESTING!"
putStrLn x
"org-babel-haskell-eoe"
Prelude|
<interactive>:4:1: parse error on …Run Code Online (Sandbox Code Playgroud) 我正在使用与此类似的使用 python、folium 和 geojson 创建的地图。
然而,这个图像不是交互式 HTML 文档,我宁愿简单地将它导出为 png 或 svg。
使用语法:
m = folium.Map( # etc..)
m.save("filename.png")
Run Code Online (Sandbox Code Playgroud)
保存文件,但它仍然是 HTML,而不是 png。渲染 not-to-html 的正确输出命令是什么?
我按照本教程在亚马逊Mturk上创建了HIT.我注意到,不过,我所有的HIT被列为单独的任务---我必须点击在"单独管理命中" 右上,在这里,而不是看下的"批量进行中"链接什么.
即使在检查了文档之后,我似乎无法找到如何对boto创建的HIT进行分组:http: //boto.readthedocs.org/en/latest/ref/mturk.html
但在亚马逊上发现这仍然是一个悬而未决的问题:https: //forums.aws.amazon.com/thread.jspa?threadID = 24993
任何想法或更新或有谁知道如何做到这一点?