<?xml version="1.0" encoding="utf-8" standalone="yes" ?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
  <channel>
    <title>Python on 备忘</title>
    <link>https://blog.witd.in/tags/python/</link>
    <description>Recent content in Python on 备忘</description>
    <generator>Hugo -- gohugo.io</generator>
    <language>en-us</language>
    <managingEditor>kongfei605@gmail.com (kongfei)</managingEditor>
    <webMaster>kongfei605@gmail.com (kongfei)</webMaster>
    <copyright>(c) 2022 witd. All rights reserved</copyright>
    <lastBuildDate>Sun, 31 Jan 2016 15:19:27 +0800</lastBuildDate>
    
	<atom:link href="https://blog.witd.in/tags/python/index.xml" rel="self" type="application/rss+xml" />
    
    
    <item>
      <title>pandas sum函数小结</title>
      <link>https://blog.witd.in/2016/01/31/pandas-sum%E5%87%BD%E6%95%B0%E5%B0%8F%E7%BB%93/</link>
      <pubDate>Sun, 31 Jan 2016 15:19:27 +0800</pubDate>
      <author>kongfei605@gmail.com (kongfei)</author>
      <guid>https://blog.witd.in/2016/01/31/pandas-sum%E5%87%BD%E6%95%B0%E5%B0%8F%E7%BB%93/</guid>
      <description>&lt;p&gt;&lt;a href=&#34;http://pandas.pydata.org/pandas-docs/version/0.17.1/generated/pandas.DataFrame.sum.html&#34;&gt;sum()函数文档&lt;/a&gt;中说sum的作用是Return the sum of the values for the requested axis ，即返回指定栏或列的值的和。&lt;/p&gt;

&lt;p&gt;函数有4个有名参数，
&lt;code&gt;axis=None, skipna=None, level=None, numeric_only=None, **kwargs&lt;/code&gt; 。 不指定任何参数时即给axis赋值。&lt;/p&gt;

&lt;p&gt;当sum(1)时是求行的和，当sum(0)时是求列的和。理解这个用法时参考了这个链接：&lt;a href=&#34;http://blog.mathandpencil.com/column-and-row-sums/&#34;&gt;http://blog.mathandpencil.com/column-and-row-sums/&lt;/a&gt;
 &lt;/p&gt;

&lt;p&gt;If you want to do a row sum in pandas, given the dataframe df:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;python df.sum(axis=1)
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;and a column sum:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;python df.sum(axis=0)
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;&lt;/p&gt;</description>
    </item>
    
    <item>
      <title>python空格与tab转换</title>
      <link>https://blog.witd.in/2014/10/04/python%E7%A9%BA%E6%A0%BC%E4%B8%8Etab%E8%BD%AC%E6%8D%A2/</link>
      <pubDate>Sat, 04 Oct 2014 15:51:01 +0800</pubDate>
      <author>kongfei605@gmail.com (kongfei)</author>
      <guid>https://blog.witd.in/2014/10/04/python%E7%A9%BA%E6%A0%BC%E4%B8%8Etab%E8%BD%AC%E6%8D%A2/</guid>
      <description>&lt;p&gt;vim中&lt;/p&gt;

&lt;p&gt;TAB替换为空格：&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;:set ts=4
:set expandtab
:%retab!
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;空格替换为TAB：&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;:set ts=4
:set noexpandtab
:%retab!
&lt;/code&gt;&lt;/pre&gt;</description>
    </item>
    
  </channel>
</rss>