结果:找到“group by”相关内容87个,排序为按回复时间降序,搜索更多相关帖子请点击“高级”
dplyr中group_by处理玩summarise的n()报错
5 个回复 - 6645 次查看
dplyr中
group_
by处理玩summarise的n()报错在gp1gp2生成的位置
Error: n() should only be called in a data context
Call `rlang::last_error()` to see a backtrace
2019-3-29 21:44 - dingziqi - R语言论坛
pandas获取groupby分组里最大值所在的行方法
0 个回复 - 1541 次查看
import pandas as pd
df = pd.DataFrame({'Sp':['a','b','c','d','e','f'], 'Mt':['s1', 's1', 's2','s2','s2','s3'],
'Value':[1,2,3,4,5,6],
'Count':[3,2,5,10,10,6]
})
[/ ...
2022-1-25 17:36 - yunnandlg - python论坛
真心求教,关于python中groupby函数分组后提取指定数据的问题
1 个回复 - 1289 次查看
In[46]:
#分段处理数据,获取各段停留状态的时间差
for name,df in g:
x = np.array(df['时间差'].values)
#y = np.array(df['tag1'].values)
if x.shape[0] == 0:
continue
stayTim ...
2021-8-30 11:14 - 莹莹光 - python论坛
python中series的groupby
1 个回复 - 1344 次查看
今天在学习时,看到一个数据类型叫“SeriesGroupBy”,并且看到这样一个示例:>>> s = pd.Series([1, 2, 3, 4]) >>> s0 11 22 33 4dtype: int64 >>> s.
groupby([1, 1, 2, 2]).min()1 1
2 3第一次见到一 ...
2020-9-1 20:28 - zwy_0309 - python论坛
Groupby-Pandas-User Guide原文翻译5
0 个回复 - 927 次查看
DataFrame column selectionin GroupBy¶
Once you have created the GroupBy object from a DataFrame, youmight want to do something different for each of the columns. Thus, using [] similar to gett ...
2020-5-16 13:30 - sunrun19840306 - python论坛
Groupby-Pandas-User Guide原文翻译4
0 个回复 - 493 次查看
Grouping DataFrame withIndex levels and columns¶A DataFrame may be
grouped
by a combination of columns and indexlevels
by specifying the column names as strings and the index levels as pd.Grouper ...
2020-5-15 08:38 - sunrun19840306 - python论坛
Groupby-Pandas-User Guide原文翻译3
0 个回复 - 647 次查看
GroupBy with MultiIndex¶514With hierarchically-indexeddata, it’s quite natural to
group byone of the levels of the hierarchy.Let’s create a Series with a two-level MultiIndex.GroupBy多索引,伴随 ...
2020-5-14 16:04 - sunrun19840306 - python论坛
Groupby-Pandas-User Guide原文翻译2
0 个回复 - 692 次查看
Note that
groupbywill preserve the order in which observationsare sorted withineach
group. For example, the
groups created
by groupby()below are in the order they appeared in the original DataFrame: ...
2020-5-13 09:05 - sunrun19840306 - python论坛
R语言group_by如何进行分组统计
4 个回复 - 6364 次查看
求问各位大神,在进行学校面板数据处理的时候,分两个组,对照组和实验组。对照组记为0,实验组记为1。那么在分析数据时想分别统计出对照组的学校个数和实验组的学校个数。应该如何编写
group_
by语句呢。谢谢!
...
2019-12-5 06:59 - 把君诗过日0 - R语言论坛
sas by 2 groups counts
0 个回复 - 461 次查看
如何用sas做到
by ID ID_2 Program_code
我需要找出每個ID下連續的第一條是X 的Program_code 並且連續同是X要找出來。如果第一條發生的是A之後是X,這些X不需要取出。每個ID2都是獨立的.ID2是顯示每一條program的前後 ...
2019-9-7 11:42 - kk2976 - SAS专版
R语言 分组计算,不止group_by
1 个回复 - 2746 次查看
原创:拴小林 数据驱动实践2019-08-30 21:55:14最近在研究excel透视图,想到好像自己在R-分组操作并不是很流畅,顺便学习分享一下。R自带数据集比较多,今天就选择一个我想对了解的mtcars数据集带大家学习一下R语言中 ...
2019-9-4 12:34 - 林随机漫步 - R语言论坛
SAS Advance第15题,sas sql group by语句
2 个回复 - 1533 次查看
请问下面这两个区别在哪里? 谢谢。
proc sql;
select rep, max(cost)
from work.one
group by rep;
quit;
proc sql;
select o.rep, (select max(cost) from work.one as i where i.rep=o.rep)
from ...
2019-3-18 12:35 - ilovejosh - SAS专版
group_by的问题
2 个回复 - 3115 次查看
老师们好,我想用一个
group_
by分组求和,我觉得语句写的没有问题,但是算出来的和是总的和,没有分组,是哪里的问题呢?
rmb3 %>%
group_
by(排期日期,常委,省负责人,拉排期省份) %>%
summarise(预报排 ...
2018-10-23 10:29 - 阿璇tian - R语言论坛
求解决egen group不能和by连用的困惑
16 个回复 - 5068 次查看
想请教一个问题,我在用 egen id=
group(year auditorfirm manager) 时,出现的结果如照片。而我想实现的是每年同一公司内部,对manager的大小进行排序,同时manager重复的值,排序数字相同:2008年对“安永”的id是 ...
2017-12-21 15:00 - bwusxyrdlt - Stata专版
sql的group by后面跟着的having不能用in吗?
4 个回复 - 5201 次查看
proc sql;
create table screen as select * from origin
group by SUBJID having VISITNUM in (min(VISITNUM) max(VISITNUM));
quit;
这句话错在哪?log提示: ...
2016-11-16 09:25 - fyp198744 - SAS专版
sas sql中group by用法的疑问
6 个回复 - 13688 次查看
数据源很简单! 数据源与程序如下:
很明显,我是想用sql
group by让他统计每只股票的数量
我百度了goup
by的用法, 我的写法与上面一模一样, 为什么它就是说
"GROUP BY 子句已变换为 ORDER BY 子句,因为 ...
2016-11-4 17:09 - the_fly_winds - SAS专版
SAS中用group by 连接文本字段内容
1 个回复 - 3215 次查看
各位大侠,请问使用
group by分组汇总数据时,如何将字段中的文本使用顿号连接?类似于cats函数的功能。但是cats函数zai这个里头好像不起作用。
比如下图,如果polnum相同,则将出险地点用顿号连接: ...
2015-11-23 17:49 - wybie - SAS专版
如何按国家给公司分组,group不能与by连用
7 个回复 - 5728 次查看
by country: egen company=
group(Companyname)
egen ...
group() may not be combined with
by
r(190);
bysort country: egen company=
group(Companyname)
egen ...
group() may not be combined with
by
r ...
2015-3-23 16:06 - 天斯吾下 - Stata专版
egen group不能跟by一起用?
4 个回复 - 5700 次查看
数据结构是unbalanced panel, (有国家,公司,年份以及其他变量),现在我想得到每个国家中公司的个数,试了用
by country: egen firm_n=
group(firm), 可是egen不能跟
by一起用,请问有什么其他结决方法吗? 希望提供 ...
2012-9-29 14:02 - tryingbing - Stata专版
Wendy's/Arby's Group 2010 Annual Report
0 个回复 - 863 次查看
Wendy's/Ar
by's Group, Inc. is the third largest quick-service restaurant
company in the United States and includes Wendy's International, Inc., the
franchisor of the Wendy's?restaurant system, and ...
2012-10-23 13:17 - Jameszone - 行业分析报告