小编Mad*_*een的帖子

如何在python中的pandas中将"YYYY/MM"类型日期转换为"MMM-YYYY"

我想做的事:

# I have col names in pandas DF such as :
data   2017/01   2017/02  2017/03 ....
 ABC     12       22        08    ....
 EFG     07       16        12    ....   
Run Code Online (Sandbox Code Playgroud)

我想转换col名称:

data   Jan-2017   Feb-2017   Mar-2017  ....
 ABC     12       22        08         ....
 EFG     07       16        12         ....   
Run Code Online (Sandbox Code Playgroud)

我尝试过以下方法:

pd.to_datetime(pd.Series(['2017/01']), format="%Y/%m")
Run Code Online (Sandbox Code Playgroud)

其中,导致:

  0   2017-01-01
  dtype: datetime64[ns]
Run Code Online (Sandbox Code Playgroud)

但我不知道如何得到我想要的结果.任何的想法?

python pandas

4
推荐指数
1
解决办法
1164
查看次数

Ubuntu上的Anaconda - 使用conda命令更新权限出错

在Windows 8.1的笔记本电脑上,我安装了vmware和ubuntu 16.4.

我最近安装了Anaconda 2.7(x64).安装anaconda的目录是:

 /home/anaconda2/
Run Code Online (Sandbox Code Playgroud)

当我尝试使用以下命令更新包时,我遇到了如下所述的错误:

 conda update --all
Run Code Online (Sandbox Code Playgroud)

错误

 Error: Missing write permissions in: /home/anaconda2
Run Code Online (Sandbox Code Playgroud)

我尝试使用sudo,并尝试在visudo下写下以下权限

madhu ALL=(ALL:ALL)  ALL
Run Code Online (Sandbox Code Playgroud)

没有用......

有人可以帮帮我吗?

python permissions ubuntu sudo

3
推荐指数
1
解决办法
6496
查看次数

在R中查找文本中最常出现的单词

有人可以帮我解决如何使用R在文本中找到最常用的两个和三个单词吗?

我的文字是......

text <- c("There is a difference between the common use of the term phrase and its technical use in linguistics. In common usage, a phrase is usually a group of words with some special idiomatic meaning or other significance, such as \"all rights reserved\", \"economical with the truth\", \"kick the bucket\", and the like. It may be a euphemism, a saying or proverb, a fixed expression, a figure of speech, etc. In grammatical analysis, particularly in theories of …
Run Code Online (Sandbox Code Playgroud)

r n-gram

2
推荐指数
3
解决办法
4134
查看次数

标签 统计

python ×2

n-gram ×1

pandas ×1

permissions ×1

r ×1

sudo ×1

ubuntu ×1