我试图使用ARMA ARIMA模型预测每周销售额.我找不到调整顺序(p,d,q)的函数statsmodels
.目前R具有forecast::auto.arima()
调整(p,d,q)参数的功能.
如何为我的模型选择正确的订单?为此目的,python中是否有可用的库?
有没有办法获取DynamoDB表上最新更新的时间戳?
我试图检查字符串是否以相同的单词开头和结尾.例如earth
.
s=raw_input();
m=re.search(r"^(earth).*(earth)$",s)
if m is not None:
print "found"
Run Code Online (Sandbox Code Playgroud)
我的问题是当字符串只包含一个单词时,例如:earth
目前我已经硬编码了这个案例
if m is not None or s=='earth':
print "found"
Run Code Online (Sandbox Code Playgroud)
有没有其他方法可以做到这一点?
编辑:
字符串中的单词用空格分隔.寻找正则表达式解决方案
some examples
:
"地球是地球","地球", - > valid
"earthearth","eartheeearth","earth earth mars" - > invalid
我在iOS应用程序中以模态方式呈现视图控制器.问题是没有崩溃,应用程序会在调用presentViewController:animated时冻结.统计信息显示CPU使用率为100%,即使在手动关闭应用程序后,使用率也不会下降.
UIStoryboard *sb = [UIStoryboard storyboardWithName:@"Main" bundle:nil];
CustomModalViewController *vvc = [sb instantiateViewControllerWithIdentifier:@"CustomModalViewController"];
if(!vvc){
NSLog(@"ERROR!!! vvc is null");
}
NSLog(@"instantiate modal view controller");
vvc.providesPresentationContextTransitionStyle = YES;
vvc.definesPresentationContext = YES;
vvc.data = data;
NSLog(@"before presenting modal view controller");
[vvc setModalPresentationStyle:UIModalPresentationOverCurrentContext];
[self presentViewController:vvc animated:YES completion:nil];
Run Code Online (Sandbox Code Playgroud)
我尝试在我的自定义类的viewDidLoad中打印一些调试语句,但这些也没有被调用.
我不明白为什么没有显示视图控制器.任何帮助将不胜感激.我想知道在什么情况下你的应用程序在推送视图控制器时进入无限循环,还是因为其他原因?
更新:
我更新到XCode 7后发生此错误.不确定,但我想这可能是新SDK-UIKit或LLVM编译器的问题.我用Xcode 6.4将我的项目复制到另一个mac,错误消失了!我没有更改任何会导致问题的构建设置.
有关如何进行的任何指示?
我正在尝试在Google Container Engine上安装远程文件系统。我正在关注本教程:https : //www.digitalocean.com/community/tutorials/how-to-use-sshfs-to-mount-remote-file-systems-over-ssh
使用以下sshfs命令:
sudo sshfs -o sshfs_debug,allow_other <instance-name>.<region>.<project_id>:/home/<user_name> /mnt/gce-container
Run Code Online (Sandbox Code Playgroud)
我收到错误消息:
SSHFS version 2.5
read: Connection reset by peer
Run Code Online (Sandbox Code Playgroud)
我引用了此链接https://cloud.google.com/sdk/gcloud/reference/compute/config-ssh ,可以通过以下命令使用ssh登录:
$gcloud compute config-ssh
$ssh <instance-name>.<region>.<project_id>
Run Code Online (Sandbox Code Playgroud)
有什么想法可能出什么问题吗?我不明白我应该使用什么密钥和用户名登录sshfs。
更新(11/5):我正在使用以下命令:
sshfs -o IdentityFile=~/.ssh/google_compute_engine <user>@<ip>:~/ /mnt/gce`
Run Code Online (Sandbox Code Playgroud)
我为我的用户更改了/ mnt / gce文件夹。我检查了IP是否与〜/ .ssh / config文件中的条目匹配。但是我仍然收到错误read: Connection reset by peer
在Ruby中使用Hash时除外
d = {}
d["a"]=1234
d["b"]=34
d["c"]=3
d.except(:b,:c)
Run Code Online (Sandbox Code Playgroud)
我得到NoMethodError:
NoMethodError: undefined method `except' for {"a"=>1234, "b"=>34, "c"=>3}:Hash from (irb):6 from
/Users/niranjan/.rvm/rubies/ruby-1.9.3-p551/bin/irb:12:in `<main>'
Run Code Online (Sandbox Code Playgroud)
我究竟做错了什么?
python ×2
forecasting ×1
hash ×1
ios ×1
r ×1
regex ×1
ruby ×1
sshfs ×1
statsmodels ×1
time-series ×1
xcode6 ×1
xcode7 ×1