<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
  <channel>
    <title>Pandas on Eryk&#39;s Blog</title>
    <link>https://eryk.github.io/tags/pandas/</link>
    <description>Recent content in Pandas on Eryk&#39;s Blog</description>
    <generator>Hugo</generator>
    <language>zh-CN</language>
    <copyright>© 2017–2026 Eryk</copyright>
    <lastBuildDate>Sun, 27 Dec 2020 22:53:00 +0000</lastBuildDate>
    <atom:link href="https://eryk.github.io/tags/pandas/index.xml" rel="self" type="application/rss+xml" />
    <item>
      <title>Pandas缺失值可视化分析模块：missingno</title>
      <link>https://eryk.github.io/2020/12/27/pandas%E7%BC%BA%E5%A4%B1%E5%80%BC%E5%8F%AF%E8%A7%86%E5%8C%96%E5%88%86%E6%9E%90%E6%A8%A1%E5%9D%97missingno/</link>
      <pubDate>Sun, 27 Dec 2020 22:53:00 +0000</pubDate>
      <guid>https://eryk.github.io/2020/12/27/pandas%E7%BC%BA%E5%A4%B1%E5%80%BC%E5%8F%AF%E8%A7%86%E5%8C%96%E5%88%86%E6%9E%90%E6%A8%A1%E5%9D%97missingno/</guid>
      <description>&lt;p&gt;missingno提供了一个灵活且易于使用的丢失数据可视化工具和实用程序的小型工具集，使您可以快速直观地概述数据集的完整性（或缺乏完整性）。只需pip install missingno就可以开始使用了&lt;/p&gt;</description>
    </item>
    <item>
      <title>使用Pandas开发一个均线策略</title>
      <link>https://eryk.github.io/2019/04/24/%E4%BD%BF%E7%94%A8pandas%E5%BC%80%E5%8F%91%E4%B8%80%E4%B8%AA%E5%9D%87%E7%BA%BF%E7%AD%96%E7%95%A5/</link>
      <pubDate>Wed, 24 Apr 2019 20:47:00 +0000</pubDate>
      <guid>https://eryk.github.io/2019/04/24/%E4%BD%BF%E7%94%A8pandas%E5%BC%80%E5%8F%91%E4%B8%80%E4%B8%AA%E5%9D%87%E7%BA%BF%E7%AD%96%E7%95%A5/</guid>
      <description>&lt;p&gt;我的微信公众号：pyquant&lt;/p&gt;&#xA;&lt;p&gt;&lt;img src=&#34;https://raw.githubusercontent.com/eryk/blog_img/master/20190424095328.jpg&#34; alt=&#34;&#34;&gt;&lt;/p&gt;&#xA;&lt;p&gt;大家好，这篇文章我将使用Pandas创建一个简单的均线交叉策略，以500ETF作为标的物进行回测&lt;/p&gt;&#xA;&lt;p&gt;移动平均线可能是技术指标里的&amp;quot;hello world&amp;quot;了，常用的均线有5、10、20、60、120日均线，在其他时间周期上应用移动平均线指标也是类似方式。&lt;/p&gt;</description>
    </item>
    <item>
      <title>pandas使用pivot时遇到Index contains duplicate entries, cannot reshape</title>
      <link>https://eryk.github.io/2017/08/10/pandas%E4%BD%BF%E7%94%A8pivot%E6%97%B6%E9%81%87%E5%88%B0index-contains-duplicate-entries-cannot-reshape/</link>
      <pubDate>Thu, 10 Aug 2017 16:54:53 +0000</pubDate>
      <guid>https://eryk.github.io/2017/08/10/pandas%E4%BD%BF%E7%94%A8pivot%E6%97%B6%E9%81%87%E5%88%B0index-contains-duplicate-entries-cannot-reshape/</guid>
      <description>&lt;p&gt;原始数据样例如下：&lt;/p&gt;&#xA;&lt;div class=&#34;highlight&#34;&gt;&lt;div style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;&#34;&gt;&#xA;&lt;table style=&#34;border-spacing:0;padding:0;margin:0;border:0;&#34;&gt;&lt;tr&gt;&lt;td style=&#34;vertical-align:top;padding:0;margin:0;border:0;&#34;&gt;&#xA;&lt;pre tabindex=&#34;0&#34; style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;&#34;&gt;&lt;code&gt;&lt;span style=&#34;white-space:pre;-webkit-user-select:none;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f&#34;&gt;1&#xA;&lt;/span&gt;&lt;span style=&#34;white-space:pre;-webkit-user-select:none;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f&#34;&gt;2&#xA;&lt;/span&gt;&lt;span style=&#34;white-space:pre;-webkit-user-select:none;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f&#34;&gt;3&#xA;&lt;/span&gt;&lt;span style=&#34;white-space:pre;-webkit-user-select:none;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f&#34;&gt;4&#xA;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;&#xA;&lt;td style=&#34;vertical-align:top;padding:0;margin:0;border:0;;width:100%&#34;&gt;&#xA;&lt;pre tabindex=&#34;0&#34; style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;&#34;&gt;&lt;code class=&#34;language-fallback&#34; data-lang=&#34;fallback&#34;&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;date        code    count&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;20170801    000001      10&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;20170802    000002      20&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;20170803    000001      30&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;&#xA;&lt;/div&gt;&#xA;&lt;/div&gt;&lt;p&gt;使用pivot处理数据，命令如下：&lt;/p&gt;&#xA;&lt;blockquote&gt;&#xA;&lt;p&gt;df.pivot(index=&amp;lsquo;date&amp;rsquo;,columns=&amp;lsquo;code&amp;rsquo;,values=&amp;lsquo;count&amp;rsquo;)&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&lt;p&gt;执行后报错信息：&lt;/p&gt;&#xA;&lt;blockquote&gt;&#xA;&lt;p&gt;ValueError: Index contains duplicate entries, cannot reshape&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&lt;p&gt;说明column有重复信息，使用如下命令检查重复列内容：&lt;/p&gt;</description>
    </item>
  </channel>
</rss>
