<?xml version="1.0" encoding="utf-8" ?><rss version="2.0"><channel><title><![CDATA[米Py的自留地]]></title><description><![CDATA[采数互联网，悠然见Python！]]></description><link>https://blog.csdn.net/Chihwei_Hsu</link><language>zh-cn</language><generator>https://blog.csdn.net/</generator><copyright><![CDATA[Copyright &copy; Chihwei_Hsu]]></copyright><item><title><![CDATA[Leecode-刷题目录（Python）]]></title><link>https://blog.csdn.net/Chihwei_Hsu/article/details/116903823</link><guid>https://blog.csdn.net/Chihwei_Hsu/article/details/116903823</guid><author>Chihwei_Hsu</author><pubDate>Sun, 16 May 2021 21:58:47 +0800</pubDate><description><![CDATA[第一周（递归）
leetcode 104.二叉树的最大深度
题目描述

题解


leetcode 62.不同路径
剑指 Offer 16. 数值的整数次方
leetcode 4. 寻找两个正序数组的中位数

]]></description><category></category></item><item><title><![CDATA[PicGo+jsDelivr+GitHub搭建免费cdn加速图床]]></title><link>https://blog.csdn.net/Chihwei_Hsu/article/details/115603075</link><guid>https://blog.csdn.net/Chihwei_Hsu/article/details/115603075</guid><author>Chihwei_Hsu</author><pubDate>Sun, 11 Apr 2021 17:44:33 +0800</pubDate><description><![CDATA[前言

基于PicGo + GitHub＋jsDelivr搭建免费的CDN加速图床。

下载&amp;安装PicGo

PicGo 下载地址: https://github.com/Molunerfinn/picgo/releases，如图下载正常安装：


创建 GitHub 仓库
可在自己的GitHub账户下建立一个新的仓库或者和我这样新建一个专门用来放这些杂七杂八东西的组织，在组织里新建仓库：


生成Token

点自己头像，点 Settings
  

点Developer settings,再点]]></description><category></category></item><item><title><![CDATA[数据结构与算法之美]]></title><link>https://blog.csdn.net/Chihwei_Hsu/article/details/115599765</link><guid>https://blog.csdn.net/Chihwei_Hsu/article/details/115599765</guid><author>Chihwei_Hsu</author><pubDate>Sun, 11 Apr 2021 15:09:00 +0800</pubDate><description><![CDATA[数据结构与算法之美

概念

数据结构
指一组数据的存储结构
图书馆储藏书籍，为了方便查找，一般会将书籍分门别类进行“存储”；按照一定规律编号，就是书籍这种“数据”的存储结构


算法
操作数据的一组方法
那如何来查找一本书呢？有很多种办法，你当然可以一本一本地找，也可以先根据书籍类别的编号，是人文，还是科学、计算机，来定位书架，然后再依次查找；笼统地说，这些查找方法都是算法


数据结构是为算法服务的，算法要作用在特定的数据结构之上


roadMap

脑图
  
复杂度分析
时间复杂度
最好、最坏、平]]></description><category></category></item><item><title><![CDATA[高性价比办公笔记本推荐（202003）]]></title><link>https://blog.csdn.net/Chihwei_Hsu/article/details/105184282</link><guid>https://blog.csdn.net/Chihwei_Hsu/article/details/105184282</guid><author>Chihwei_Hsu</author><pubDate>Sun, 29 Mar 2020 19:41:09 +0800</pubDate><description><![CDATA[起因

大学室友突然找到我说自己的那台老电脑太卡了，要换个办公用电脑，而我是我们寝室唯一一个野生程序员，所以，这个大任就交给我了

推荐

话不多少，直接上推荐列表，无脑的根据预算与个人喜好从下方推荐中挑选就好
免责声明：无任何利益相关，只是记录下劳动结果，顺便给大家做个参考，所以，这里只推荐机型及京东链接。

amd 系列（预算有限AMD，不要太爽）
联想(Lenovo)小新Pro13.3英寸全...]]></description><category></category></item><item><title><![CDATA[我的新博客地址]]></title><link>https://blog.csdn.net/Chihwei_Hsu/article/details/87867807</link><guid>https://blog.csdn.net/Chihwei_Hsu/article/details/87867807</guid><author>Chihwei_Hsu</author><pubDate>Thu, 21 Feb 2019 20:21:42 +0800</pubDate><description><![CDATA[]]></description><category></category></item><item><title><![CDATA[一句话系列：姓名模糊匹配算法]]></title><link>https://blog.csdn.net/Chihwei_Hsu/article/details/84258414</link><guid>https://blog.csdn.net/Chihwei_Hsu/article/details/84258414</guid><author>Chihwei_Hsu</author><pubDate>Mon, 19 Nov 2018 19:14:52 +0800</pubDate><description><![CDATA[一句话系列：姓名模糊匹配算法

关键点：使用相同字符做切片，根据切片结果，进行匹配（split）
功效：

对中文姓名进行模糊匹配


import re
list_ = [(&amp;amp;amp;quot;赵紫斌&amp;amp;amp;quot;, &amp;amp;amp;quot;赵*斌&amp;amp;amp;quot;), (&amp;amp;amp;quot;李方雪&amp;amp;amp;quot;, &amp;amp;amp;quot;李**&amp;amp;amp;quot;), (]]></description><category></category></item><item><title><![CDATA[白话文系列：正则split&字符串split]]></title><link>https://blog.csdn.net/Chihwei_Hsu/article/details/84258286</link><guid>https://blog.csdn.net/Chihwei_Hsu/article/details/84258286</guid><author>Chihwei_Hsu</author><pubDate>Mon, 19 Nov 2018 19:05:55 +0800</pubDate><description><![CDATA[白话文系列：re.split&amp;amp;str.split

正则split：

一次能处理多个
更灵活
能保留分割符



字符串split：

简单好用


a =&quot;王大锤&quot;
b = &quot;*大*&quot;
import re
pat = u&quot;([\u4e00-\u9fff]+)&quot;
pattern = re.compile(pat)
results = pattern.findall(b)
print(re...]]></description><category></category></item><item><title><![CDATA[一句话系列：列表（list）去除所有指定元素]]></title><link>https://blog.csdn.net/Chihwei_Hsu/article/details/84258124</link><guid>https://blog.csdn.net/Chihwei_Hsu/article/details/84258124</guid><author>Chihwei_Hsu</author><pubDate>Mon, 19 Nov 2018 18:53:17 +0800</pubDate><description><![CDATA[一句话系列：列表（list）去除所有指定元素

功效：迅速从列表中剔除不需要的数据

from operator import is_not
from functools import partial
L = [0, 23, 234, 89, '', 0, 35, 9]
print([i for i in L if i not in [None]])
print(list(filter(parti...]]></description><category></category></item><item><title><![CDATA[一句话系列：字符串清洗（邻位去重&去所有空格）]]></title><link>https://blog.csdn.net/Chihwei_Hsu/article/details/84258053</link><guid>https://blog.csdn.net/Chihwei_Hsu/article/details/84258053</guid><author>Chihwei_Hsu</author><pubDate>Mon, 19 Nov 2018 18:47:33 +0800</pubDate><description><![CDATA[一句话系列：字符串清洗（邻位去重&amp;amp;去所有空格）

功效：

邻位去重
去除所有空格符


import itertools
data = &quot;测测  试试试&quot;
&quot;&quot;.join(([i[0] for i in itertools.groupby(&quot;&quot;.join(data.split()))]))



...]]></description><category></category></item><item><title><![CDATA[报错：unzip2: command not found]]></title><link>https://blog.csdn.net/Chihwei_Hsu/article/details/84032946</link><guid>https://blog.csdn.net/Chihwei_Hsu/article/details/84032946</guid><author>Chihwei_Hsu</author><pubDate>Tue, 13 Nov 2018 17:47:41 +0800</pubDate><description><![CDATA[问题

安装anaconda时，报错：bunzip2: command not found


解决办法

安装bzip2，yum install -y bzip2


]]></description><category></category></item><item><title><![CDATA[Pandas auto convert list to tuple error]]></title><link>https://blog.csdn.net/Chihwei_Hsu/article/details/83830107</link><guid>https://blog.csdn.net/Chihwei_Hsu/article/details/83830107</guid><author>Chihwei_Hsu</author><pubDate>Wed, 07 Nov 2018 19:17:15 +0800</pubDate><description><![CDATA[Pandas 自动转格式（list to tuple）问题
问题描述

一向稳定的线上，突然报出一个错误：
AttributeError: 'tuple' object has no attribute 'remove'
意思是元组（tuple）没有remove方法，但是代码逻辑设计的是针对列表（list）使用的，且安全生产了很久很久……

结果

经过不懈努力，目前暂时结论：pandas在处理某...]]></description><category></category></item><item><title><![CDATA[时间戳（timestamp）、时间字符串（datetimestr）、时间（datetime）之间的相互转换]]></title><link>https://blog.csdn.net/Chihwei_Hsu/article/details/83589708</link><guid>https://blog.csdn.net/Chihwei_Hsu/article/details/83589708</guid><author>Chihwei_Hsu</author><pubDate>Wed, 31 Oct 2018 20:03:31 +0800</pubDate><description><![CDATA[总览
# 时间戳转时间字符串（timestamp to datetimeStr）
def timestampToDateStr(stamps, frmt='%Y-%m-%d %H:%M:%S'):
#     return time.strftime(frmt, time.localtime(stamps))
    return datetime.fromtimestamp(stamps).st...]]></description><category></category></item><item><title><![CDATA[Python 获取时间段内的随机时间（list）、时间戳（list）]]></title><link>https://blog.csdn.net/Chihwei_Hsu/article/details/83589309</link><guid>https://blog.csdn.net/Chihwei_Hsu/article/details/83589309</guid><author>Chihwei_Hsu</author><pubDate>Wed, 31 Oct 2018 19:35:06 +0800</pubDate><description><![CDATA[获取两个时间点间的随机时间
方案一
# python2 不兼容，python3正常
import datetime,random
def randomtimes(start, end, n, frmt=&amp;amp;quot;%Y-%m-%d&amp;amp;quot;):
    stime = datetime.datetime.strptime(start, frmt)
    etime = datetime.datetime.strp...]]></description><category></category></item><item><title><![CDATA[获取6个月前首日的时间戳]]></title><link>https://blog.csdn.net/Chihwei_Hsu/article/details/83589157</link><guid>https://blog.csdn.net/Chihwei_Hsu/article/details/83589157</guid><author>Chihwei_Hsu</author><pubDate>Wed, 31 Oct 2018 19:23:56 +0800</pubDate><description><![CDATA[获取6个月前首日的时间戳

先获取月份
在获取首日
再转换为时间戳

import time,datetime
from dateutil.relativedelta import relativedelta
time.mktime(time.strptime((datetime.today() + relativedelta(months=-5)).strftime('%Y-%m-01 00:0...]]></description><category></category></item><item><title><![CDATA[Python获取mongo文档的size大小]]></title><link>https://blog.csdn.net/Chihwei_Hsu/article/details/83501555</link><guid>https://blog.csdn.net/Chihwei_Hsu/article/details/83501555</guid><author>Chihwei_Hsu</author><pubDate>Mon, 29 Oct 2018 09:56:24 +0800</pubDate><description><![CDATA[使用bson模块得到mongo返回文档大小
import bson
res = db['log'].find_one({&quot;sid&quot;: test_id})
print len(bson.BSON.encode(res)) # B
print len(bson.BSON.encode(res))*1.0/1024/1024 # MB
print len(bson.BSON.encode(res))*1...]]></description><category></category></item><item><title><![CDATA[python中使用mongo中的_id（ObjectId）]]></title><link>https://blog.csdn.net/Chihwei_Hsu/article/details/83501434</link><guid>https://blog.csdn.net/Chihwei_Hsu/article/details/83501434</guid><author>Chihwei_Hsu</author><pubDate>Mon, 29 Oct 2018 09:49:35 +0800</pubDate><description><![CDATA[在Python中导入ObjectId
from bson.objectid import ObjectId
a = [ObjectId('5bd184790640307f2515c99e'), ObjectId('5bd184790640307f2515c99f')]
# map(lambda x: x.toString(), a)
str(a)



]]></description><category></category></item><item><title><![CDATA[pandas对时间索引进行分割（truncate requires a sorted index）]]></title><link>https://blog.csdn.net/Chihwei_Hsu/article/details/83063388</link><guid>https://blog.csdn.net/Chihwei_Hsu/article/details/83063388</guid><author>Chihwei_Hsu</author><pubDate>Mon, 15 Oct 2018 19:28:12 +0800</pubDate><description><![CDATA[情景

开发时碰到需要截取近1个月，近3个月，近6个月的数据，进行统计分析
使用truncate对df进行数据集截取，遇到截取数据不符合预期，且若时间序列无序会抛出异常

挖一挖


使用truncate时的索引必须先进行排序，不然会报错
源码一进truncate方法就会检测index是否经过排序，没有排序，报错
极端情况，若时间序列只有两个的时候不会报错，但是结果会不符合预期
预期是截取掉201...]]></description><category></category></item><item><title><![CDATA[python pandas 使用nunique去重报错：AttributeError: 'DataFrame' object has no attribute 'nunique']]></title><link>https://blog.csdn.net/Chihwei_Hsu/article/details/82379153</link><guid>https://blog.csdn.net/Chihwei_Hsu/article/details/82379153</guid><author>Chihwei_Hsu</author><pubDate>Tue, 04 Sep 2018 10:17:24 +0800</pubDate><description><![CDATA[使用pandas进行列去重功能报错



AttributeError: 'DataFrame' object has no attribute 'nunique'





解决方案


  更新pandas版本即可




print('Pandas version ' + pd.__version__)
# Pandas version 0.19.2
pip install -U panda...]]></description><category></category></item><item><title><![CDATA[python 使用requests请求https输出警报InsecureRequestWarning]]></title><link>https://blog.csdn.net/Chihwei_Hsu/article/details/81943355</link><guid>https://blog.csdn.net/Chihwei_Hsu/article/details/81943355</guid><author>Chihwei_Hsu</author><pubDate>Wed, 22 Aug 2018 14:19:50 +0800</pubDate><description><![CDATA[问题描述


  使用requests请求https时会输出警告： 
  python2.7/site-packages/requests/packages/urllib3/connectionpool.py:852: InsecureRequestWarning: Unverified HTTPS request is being made. Adding certificate verific...]]></description><category></category></item><item><title><![CDATA[Python requests post 提交form-data表单]]></title><link>https://blog.csdn.net/Chihwei_Hsu/article/details/81943008</link><guid>https://blog.csdn.net/Chihwei_Hsu/article/details/81943008</guid><author>Chihwei_Hsu</author><pubDate>Wed, 22 Aug 2018 14:03:24 +0800</pubDate><description><![CDATA[问题：


  对接接口，发现对方的接口使用form-data进行数据提交，直接使用requests库的data参数对接，会报参数错误：


params = {
    'timestamp':timestamp,
    'nonce':nonce,
    'apikey':APIKEY,
    'signature': signature
}
data = {
    'name': n...]]></description><category></category></item></channel></rss>