<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Allen C. Kim on Medium]]></title>
        <description><![CDATA[Stories by Allen C. Kim on Medium]]></description>
        <link>https://medium.com/@allenckim?source=rss-1efc2c692c2a------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/0*RhXXMdPbrY-8lZuf.</url>
            <title>Stories by Allen C. Kim on Medium</title>
            <link>https://medium.com/@allenckim?source=rss-1efc2c692c2a------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sun, 29 Nov 2026 16:12:16 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@allenckim/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Understanding Axis in Numpy]]></title>
            <link>https://medium.com/@allenckim/understanding-axis-in-numpy-cced18591be0?source=rss-1efc2c692c2a------2</link>
            <guid isPermaLink="false">https://medium.com/p/cced18591be0</guid>
            <category><![CDATA[numpy]]></category>
            <category><![CDATA[pandas]]></category>
            <category><![CDATA[axis]]></category>
            <dc:creator><![CDATA[Allen C. Kim]]></dc:creator>
            <pubDate>Thu, 16 Mar 2017 07:20:44 GMT</pubDate>
            <atom:updated>2017-03-24T05:38:17.946Z</atom:updated>
            <content:encoded><![CDATA[<p>Data Scientist의 첫 걸음을 내딛기 위해 많은 노력을 기울이고 있다. 그 와중에 Numpy/Pandas의 Axis이라는 개념이 엄청 헷갈려서 몇일을 고생했다.</p><p>( I’m keep studying for a newbie data scientiest. In the path on the way, I faced a hurdle which kept bothering me for days; the concept of Axis in Numpy and Panda.)</p><p>아래는 Pandas, Numpy의 설명 자료에서 axis에 대한 부분을 발췌해서 필자가 이해한 방식으로 노트한 것을 옮겨 놓은 것이다. 아무쪼록 누군가에게 도움이 되었으면 한다.</p><p>(The following figure was drawn based on my understanding of Axis. I hope this can help someone who is struggling to grab the concept of the axis. The figure is self-descriptive, so you may not need the interpretation of the following explanation in Korean. ^^)</p><blockquote>Axis indicates the dimension of the given data. In above 3D matrix axis = 0 means the first dimension, axis=1 means the second one, and axis=2 menas the last one.</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*t_CY-Etmo1vZ8T-Kie4PRw.png" /></figure><p>위 그림은 3 x 2 x 2 형태의 데이터를 예를 들고 있다. 우측 위에 있는 표현이 Numpy에서 표시되는 형태이고 이를 좌측의 그림 형태로 기술할 수 있다.<br><br>Axis=0라는 건 결국 첫 번째 dimension인 (row)을 가로지는 축이라는 것이다. 여기서 헷갈리는 것이 row라고 해서 가로 축이 아니라, row을 가로지는 축을 가르킨다. 따라서. 그림에서 아래 방향으로 지정하는 것이 Axis = 0가 지정하는 방향이 된다. 따라서 이 axis을 기준으로 sum을 하게 되면 아래와 같이 표현이 된다.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/696/1*MgpQh0HPaN2Nz-nyjR_AMw.png" /></figure><p>Axis = 1이라는 것은 column을 가로지르는 방향을 뜻하게 된다. column을 가로지는 방향이기 때문에 sum()을 취하게 되면 Row 별로 sum()을 취하게 된다.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/600/1*PjWc_DrsTvxf9el8vx_HpQ.png" /></figure><p>마지막으로 Axis=2는 dimension의 마지막 부분을 가로지는 축을 나타내게 된다. <br><br>쉽게 이를 숙지하기 위해서 axis=0는 column단위로 연산을 수행한다고 생각하고, axis=1는 row단위로 연산한다고 생각하면 된다.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=cced18591be0" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>