<?xml version="1.0" encoding="utf-8" ?><rss version="2.0"><channel><title><![CDATA[W_weiying的博客]]></title><description><![CDATA[]]></description><link>https://blog.csdn.net/W_weiying</link><language>zh-cn</language><generator>https://blog.csdn.net/</generator><copyright><![CDATA[Copyright &copy; W_weiying]]></copyright><item><title><![CDATA[Python字符串：join与format函数]]></title><link>https://blog.csdn.net/W_weiying/article/details/97521704</link><guid>https://blog.csdn.net/W_weiying/article/details/97521704</guid><author>W_weiying</author><pubDate>Sat, 27 Jul 2019 15:55:57 +0800</pubDate><description><![CDATA[str.join(): 将字符插入对象中间返回一个长字符串


In  [1]: print(' and '.join(['Mary']))
         print(' and '.join(['Mary','John']))
         print(' and '.join(['Mary','John','Amy']))

Out [1]: Mary
         Mary a...]]></description><category></category></item><item><title><![CDATA[Numpy中concatenate与tile函数详解]]></title><link>https://blog.csdn.net/W_weiying/article/details/89577014</link><guid>https://blog.csdn.net/W_weiying/article/details/89577014</guid><author>W_weiying</author><pubDate>Fri, 26 Apr 2019 21:56:54 +0800</pubDate><description><![CDATA[concatenate((a1,a2,...),axis=0)

实现numpy中数据多个数组（a1,a2,...）的拼接，axis=0沿着垂直方向，axis=1沿着水平方向。


In [245]
        a=np.array([[1, 2, 4, 5]])
        b=np.array([[3, 4, 6, 7]])
        print('Horizontal \...]]></description><category></category></item><item><title><![CDATA[Numpy中vstack与hstack函数源码]]></title><link>https://blog.csdn.net/W_weiying/article/details/89505153</link><guid>https://blog.csdn.net/W_weiying/article/details/89505153</guid><author>W_weiying</author><pubDate>Thu, 25 Apr 2019 22:38:14 +0800</pubDate><description><![CDATA[vstack与hstack函数

Numpy中用来拼接数组的基础函数。

vstack( vertical stack)：将多个数组沿竖直方向拼接
	hstack( horizontal stack)：将多个数组沿水平方向拼接

In [137]    a=np.array([[1, 2, 4, 5],[1, 2, 4, 5]])
            b=np.array([[3, 4, 6,...]]></description><category></category></item><item><title><![CDATA[MYSQL中导入Excel文件]]></title><link>https://blog.csdn.net/W_weiying/article/details/88947388</link><guid>https://blog.csdn.net/W_weiying/article/details/88947388</guid><author>W_weiying</author><pubDate>Mon, 01 Apr 2019 14:50:30 +0800</pubDate><description><![CDATA[本文阐述了一般情况下怎么在mysql中导入excel文件，作者借助工具sqlyog，也可以直接在mysql中操作。

主要步骤：

第一步：首先将excel文件打开另存为csv文件



再将其用Notepad打开，将编码改成utf-8保存



第二步：先建立数据库列名一致的表格，可参考博客，本文用sqlyog创建，也可直接在mysql里面创建



再写导入sql


LOAD DATA IN...]]></description><category></category></item><item><title><![CDATA[Pandas数据去重：drop_duplicates函数详解]]></title><link>https://blog.csdn.net/W_weiying/article/details/86489922</link><guid>https://blog.csdn.net/W_weiying/article/details/86489922</guid><author>W_weiying</author><pubDate>Tue, 15 Jan 2019 15:49:57 +0800</pubDate><description><![CDATA[DataFrame.drop_duplicates(subset=None, keep='first', inplace=False)

参数解释：

subset: 列名，默认所有的列
	keep: 是否保留{‘first’, ‘last’, False}，keep= 'first' 表示去重时每组重复数据保留第一条数据，其余数据丢弃； keep='last' 表示去重时每组重复数据保留最后一条...]]></description><category></category></item><item><title><![CDATA[A value is trying to be set on a copy of a slice from a DataFrame]]></title><link>https://blog.csdn.net/W_weiying/article/details/85247115</link><guid>https://blog.csdn.net/W_weiying/article/details/85247115</guid><author>W_weiying</author><pubDate>Tue, 25 Dec 2018 14:46:42 +0800</pubDate><description><![CDATA[最近在做数据分析的时候，发现在Dataframe中插入一列之后会报这个错误


A value is trying to be set on a copy of a slice from a DataFrame.
Try using .loc[row_indexer,col_indexer] = value instead

源数据如下：


In [158]:data
Out[158]: 
  ...]]></description><category></category></item><item><title><![CDATA[Pandas 中Dataframe数据插入： Insert函数 详解]]></title><link>https://blog.csdn.net/W_weiying/article/details/85247436</link><guid>https://blog.csdn.net/W_weiying/article/details/85247436</guid><author>W_weiying</author><pubDate>Tue, 25 Dec 2018 14:44:19 +0800</pubDate><description><![CDATA[Dataframe.insert(loc, column, value, allow_duplicates=False): 在Dataframe的指定列中插入数据。

参数介绍：

       loc:  int型，表示第几列；若在第一列插入数据，则 loc=0

       column: 给插入的列取名，如 column='新的一列'

       value：数字，array，seri...]]></description><category></category></item><item><title><![CDATA[Pandas中at、iat函数详解]]></title><link>https://blog.csdn.net/W_weiying/article/details/84787423</link><guid>https://blog.csdn.net/W_weiying/article/details/84787423</guid><author>W_weiying</author><pubDate>Tue, 04 Dec 2018 14:12:18 +0800</pubDate><description><![CDATA[at 函数：通过行名和列名来取值（取行名为a, 列名为A的值）

iat 函数：通过行号和列号来取值（取第1行，第1列的值）

本文给出at、iat常见的用法，并附上详细代码。

1. 首先创建一个DataFrame（data）


Out[1]: pd.DataFrame(np.arange(15).reshape(5,3), columns=list('ABC'), index=list('a...]]></description><category></category></item><item><title><![CDATA[Pandas: Drop函数（Dataframe删除指定行列）]]></title><link>https://blog.csdn.net/W_weiying/article/details/84626260</link><guid>https://blog.csdn.net/W_weiying/article/details/84626260</guid><author>W_weiying</author><pubDate>Thu, 29 Nov 2018 14:45:53 +0800</pubDate><description><![CDATA[isin函数  （请点击链接：isin函数提取和删除Dataframe指定行列）

更多原创PYTHON数据分析博文，请关注博文专栏（超链接：PYTHON数据分析）

 

本文介绍主要结介绍用Drop函数删除Dataframe指定行列：

drop(labels=None, axis=0, index=None, columns=None,
             level=None, in...]]></description><category></category></item><item><title><![CDATA[Pandas中isin函数  Dataframe提取（删除）指定行列]]></title><link>https://blog.csdn.net/W_weiying/article/details/84618685</link><guid>https://blog.csdn.net/W_weiying/article/details/84618685</guid><author>W_weiying</author><pubDate>Thu, 29 Nov 2018 11:56:11 +0800</pubDate><description><![CDATA[本文介绍主要结介绍用isin函数提取和删除Dataframe指定行列：

isin函数（条件前加~表示isin函数的逆函数）

1. 返回含有具体条件的dataframe, 如返回 'A'列中含有 [4,8] 的dataframe( 用逆函数对筛选后的结果取余，起删除指定行作用 )


IN [1]: data
Out[1]: 
   A  B   C   D
0  0  1   2   3
1 ...]]></description><category></category></item><item><title><![CDATA[List快速去重(Python)]]></title><link>https://blog.csdn.net/W_weiying/article/details/84546998</link><guid>https://blog.csdn.net/W_weiying/article/details/84546998</guid><author>W_weiying</author><pubDate>Mon, 26 Nov 2018 15:50:50 +0800</pubDate><description><![CDATA[利用Set函数函数（set() 函数创建一个无序不重复元素集，可进行关系测试，删除重复数据，还可以计算交集、差集、并集等）


In  [1]: test=[1,2,3,4,2,3]

In  [2]: set(test)
Out [2]: {1, 2, 3, 4}

In  [3]: list(set(test))
Out [3]: [1, 2, 3, 4]

 ...]]></description><category></category></item><item><title><![CDATA[指定位置打开Jupyter Notebook]]></title><link>https://blog.csdn.net/W_weiying/article/details/83862145</link><guid>https://blog.csdn.net/W_weiying/article/details/83862145</guid><author>W_weiying</author><pubDate>Thu, 08 Nov 2018 15:52:43 +0800</pubDate><description><![CDATA[突然心血来潮，可能也是好久没更新博客了吧，回忆以前刚开始使用Jupyter的时候，也是一头雾水。

今天跟一些刚开始用的朋友们分享一个很简单，但也很实用的技巧 &quot;指定位置打开Jupyter Notebook&quot;。

建议安装 Anconda, 里面集成了 Jupyter Notebook.

举例：一个excel文件在D盘中，路径：D:\python code\JupyterCode\test.xl...]]></description><category></category></item><item><title><![CDATA[Python3创建字典（Dict）的几种常规方法]]></title><link>https://blog.csdn.net/W_weiying/article/details/83058855</link><guid>https://blog.csdn.net/W_weiying/article/details/83058855</guid><author>W_weiying</author><pubDate>Mon, 15 Oct 2018 15:28:22 +0800</pubDate><description><![CDATA[1.常规创建字典


In [1]: dict1 = {'a':1, 'b':2, 'c':3}

In [2]: print(dict1)
Out[2]: {'a': 1, 'b': 2, 'c': 3}

2. 利用zip函数和 dict函数创建字典


In [3]: list1 = ['a', 'b', 'c']; list2 = [1, 2, 3]; dict1 = dict(zip(l...]]></description><category></category></item><item><title><![CDATA[Two Sum（python）两数相加]]></title><link>https://blog.csdn.net/W_weiying/article/details/82985033</link><guid>https://blog.csdn.net/W_weiying/article/details/82985033</guid><author>W_weiying</author><pubDate>Tue, 09 Oct 2018 17:14:25 +0800</pubDate><description><![CDATA[题目：Two Sum


    Given nums = [2, 7, 11, 15], target = 9,
    Because nums[0] + nums[1] = 2 + 7 = 9,
    return [0, 1].

第一步：用 zip 函数做一个字典，将nums中数字与index联系起来：


In [33]: dictionary = dict(zip(nums, li...]]></description><category></category></item><item><title><![CDATA[Pandas中multiindex转换成列]]></title><link>https://blog.csdn.net/W_weiying/article/details/82589701</link><guid>https://blog.csdn.net/W_weiying/article/details/82589701</guid><author>W_weiying</author><pubDate>Mon, 10 Sep 2018 14:59:25 +0800</pubDate><description><![CDATA[Multiindex格式如下：（a, b, c, ...），

index
			column
		(a1,b1,c1)
			d1
		(a2,b2,c2)
			d2
		直接调用函数reset_index()，Multiindex中（a, b, c, ...）就变成columns了，index重置为（0,1,2,...), 如下：

index
			 
			 
			 
			colum...]]></description><category></category></item><item><title><![CDATA[Numpy中random.choice函数的用法举例]]></title><link>https://blog.csdn.net/W_weiying/article/details/82118160</link><guid>https://blog.csdn.net/W_weiying/article/details/82118160</guid><author>W_weiying</author><pubDate>Mon, 27 Aug 2018 19:53:04 +0800</pubDate><description><![CDATA[random.choice( list or array) 函数: 在list 或者 array中取一个数。


In  [1]: np.random.choice([1,2,3,4,5]) #随机选一个数字
Out [1]: 2

In  [2]: np.random.choice([1,2,3,4,5]) #随机选一个数字
Out [2]: 4

In  [3]: np.random.choi...]]></description><category></category></item><item><title><![CDATA[Numpy中reshape函数、reshape(1,-1)的含义(浅显易懂，源码实例)]]></title><link>https://blog.csdn.net/W_weiying/article/details/82112337</link><guid>https://blog.csdn.net/W_weiying/article/details/82112337</guid><author>W_weiying</author><pubDate>Mon, 27 Aug 2018 16:34:19 +0800</pubDate><description><![CDATA[本文详细介绍numpy中reshape函数的三种常见相关用法。

一般用法：numpy.arange(n).reshape(a, b); 依次生成n个自然数，并且以a行b列的数组形式显示:


In [1]: 
np.arange(16).reshape(2,8) #生成16个自然数，以2行8列的形式显示
Out[1]: 
array([[ 0,  1,  2,  3,  4,  5,  6,  ...]]></description><category></category></item><item><title><![CDATA[Pandas将多个Sheet写入到本地同一Excel文件中]]></title><link>https://blog.csdn.net/W_weiying/article/details/81454015</link><guid>https://blog.csdn.net/W_weiying/article/details/81454015</guid><author>W_weiying</author><pubDate>Mon, 06 Aug 2018 14:41:36 +0800</pubDate><description><![CDATA[直接上代码


import pandas as pd

#读取两个表格
data1=pd.read_excel('文件路径')
data2=pd.read_excel('文件路径')

#将两个表格输出到一个excel文件里面
writer=pd.ExcelWriter('D:新表.xlsx')
data1.to_excel(writer,sheet_name='sheet1')
data2.t...]]></description><category></category></item><item><title><![CDATA[Pandas中loc和iloc函数用法详解（源码+实例）]]></title><link>https://blog.csdn.net/W_weiying/article/details/81411257</link><guid>https://blog.csdn.net/W_weiying/article/details/81411257</guid><author>W_weiying</author><pubDate>Sat, 04 Aug 2018 15:55:40 +0800</pubDate><description><![CDATA[loc函数：通过行索引 "Index" 中的具体值来取行数据（如取"Index"为"A"的行）

iloc函数：通过行号来取行数据（如取第二行的数据）

本文给出loc、iloc常见的五种用法，并附上详细代码。

1. 利用loc、iloc提取行数据


import numpy as np
import pandas as pd
#创建一个Dataframe
data=pd.DataFrame(...]]></description><category></category></item><item><title><![CDATA[Python读取XML中数据提取为Dataframe]]></title><link>https://blog.csdn.net/W_weiying/article/details/81384954</link><guid>https://blog.csdn.net/W_weiying/article/details/81384954</guid><author>W_weiying</author><pubDate>Fri, 03 Aug 2018 11:59:21 +0800</pubDate><description><![CDATA[对应的数据集为：


&amp;lt;?xml version=&quot;1.0&quot;?&amp;gt;
-&amp;lt;opencv_storage&amp;gt;
 -&amp;lt;vocabulary type_id=&quot;opencv-matrix&quot;&amp;gt;
   &amp;lt;rows&amp;gt;424&amp;lt;/rows&amp;gt;
   &amp;lt;cols&amp;gt;512&amp;lt;/cols&amp;gt;
   &amp;]]></description><category></category></item></channel></rss>