{"html":"<iframe src=\"https://hatenablog-parts.com/embed?url=https%3A%2F%2Fryamada22.hatenablog.jp%2Fentry%2F20201227%2F1609048269\" title=\"numpy.ndarray \u3068 R\u306eapply() - ryamada\u306e\u907a\u4f1d\u5b66\u30fb\u907a\u4f1d\u7d71\u8a08\u5b66\u30e1\u30e2\" class=\"embed-card embed-blogcard\" scrolling=\"no\" frameborder=\"0\" style=\"display: block; width: 100%; height: 190px; max-width: 500px; margin: 10px 0px;\"></iframe>","type":"rich","image_url":null,"published":"2020-12-27 14:51:09","author_name":"ryamada22","version":"1.0","title":"numpy.ndarray \u3068 R\u306eapply()","categories":["python","R","apply"],"blog_title":"ryamada\u306e\u907a\u4f1d\u5b66\u30fb\u907a\u4f1d\u7d71\u8a08\u5b66\u30e1\u30e2","url":"https://ryamada22.hatenablog.jp/entry/20201227/1609048269","provider_url":"https://hatena.blog","width":"100%","blog_url":"https://ryamada22.hatenablog.jp/","provider_name":"Hatena Blog","height":"190","description":"R\u306e\u884c\u5217\u3067\u3001\u5404\u884c\u306e\u548c\u3092\u51fa\u305d\u3046\u3068\u601d\u3063\u305f\u3089 M <- matrix(rnorm(100),10,10) apply(M,1,sum) \u3060\u308d\u3046 \u540c\u3058\u3053\u3068\u3092Python\u3067\u3084\u308b\u306e\u306f\u3069\u3046\u3059\u308b\u306e\u304b\u306a\u3001\u3068\u601d\u3063\u305f Python\u3067\u884c\u5217\u3092\u6271\u3046\u306a\u3089numpy\u304c\u3088\u3044\u306e\u3067\u305d\u3046\u3059\u308b\u3053\u3068\u306b\u3057\u305f\u3068\u3057\u3066 \u5024\u306e\u30bb\u30c3\u30c8\u306e\u548c\u3092\u51fa\u3059sum()\u95a2\u6570\u3092\u3001\u8ef8\u65b9\u5411\u306b\u6307\u5b9a\u3057\u3066\u8a08\u7b97\u3059\u308b\u3053\u3068\u3082\u3067\u304d\u3066 M = np.array(np.random.randint(5,18000,100)).reshape(10,10) np.sum(M,axis=1) \u3068\u3059\u308b\u3089\u3057\u3044\u3002R\u306eapply(M,1,sum)\u3068\u540c\u3058\u69cb\u6210 \u305d\u308c\u3068\u306f\u5225\u306b\uff1a numpy\u306endarray\u2026","author_url":"https://blog.hatena.ne.jp/ryamada22/"}