楼主: winslow
1410 1

test drive of julia [推广有奖]

  • 0关注
  • 1粉丝

已卖:529份资源

本科生

55%

还不是VIP/贵宾

-

威望
0
论坛币
2512 个
通用积分
3.1196
学术水平
3 点
热心指数
5 点
信用等级
3 点
经验
282 点
帖子
60
精华
0
在线时间
95 小时
注册时间
2005-5-4
最后登录
2020-6-26

楼主
winslow 发表于 2013-12-27 13:25:36 |AI写论文

+2 论坛币
k人 参与回答

经管之家送您一份

应届毕业生专属福利!

求职就业群
赵安豆老师微信:zhaoandou666

经管之家联合CDA

送您一个全额奖学金名额~ !

感谢您参与论坛问题回答

经管之家送您两个论坛币!

+2 论坛币
   _       _ _(_)_     |  A fresh approach to technical computing
  (_)     | (_) (_)    |  Documentation: http://docs.julialang.org
   _ _   _| |_  __ _   |  Type "help()" to list help topics
  | | | | | | |/ _` |  |
  | | |_| | | | (_| |  |  Version 0.3.0-prerelease+490 (2013-12-15 07:16 UTC)
_/ |\__'_|_|_|\__'_|  |  Commit f8f3190* (0 days old master)
|__/                   |  x86_64-linux-gnu


julia> # load the package


julia> using DataFrames


julia> # read a txt file into dataframe


julia> df1 = readtable("credit_count.txt");


julia> # subset the dataframe


julia> df2 = df1[:(CARDHLDR .== 1), ["DEFAULT", "MAJORDRG", "MINORDRG"]];


julia> # aggregate the data


julia> df3 = by(df2, "DEFAULT", :(MAJOR_DRG = mean(_DF["MAJORDRG"])))
2x2 DataFrame:
        DEFAULT MAJOR_DRG
[1,]          0  0.139851
[2,]          1  0.175703




julia> df4 = by(df2, "DEFAULT", :(MINOR_DRG = mean(_DF["MINORDRG"])))
2x2 DataFrame:
        DEFAULT MINOR_DRG
[1,]          0  0.213196
[2,]          1  0.292169




julia> # join two dataframes


julia> df5 = join(df3, df4, on = "DEFAULT", kind = :inner)
2x3 DataFrame:
        DEFAULT MAJOR_DRG MINOR_DRG
[1,]          0  0.139851  0.213196
[2,]          1  0.175703  0.292169

二维码

扫码加我 拉你入群

请注明:姓名-公司-职位

以便审核进群资格,未注明则拒绝

关键词:Julia drive test DRI Jul technical master drive julia

沙发
xiadongbj 发表于 2016-6-21 09:59:11
你好,你的数据credit_count.txt从哪里下载的?盼回复。

您需要登录后才可以回帖 登录 | 我要注册

本版微信群
jg-xs1
拉您进交流群
GMT+8, 2025-12-28 16:55