<?xml version="1.0" encoding="utf-8" ?><rss version="2.0"><channel><title><![CDATA[andyTheShy的博客]]></title><description><![CDATA[]]></description><link>https://blog.youkuaiyun.com/andyTheShy</link><language>zh-cn</language><generator>https://blog.youkuaiyun.com/</generator><copyright><![CDATA[Copyright &copy; andyTheShy]]></copyright><item><title><![CDATA[python pandas 删除行或列]]></title><link>https://blog.youkuaiyun.com/andyTheShy/article/details/122595252</link><guid>https://blog.youkuaiyun.com/andyTheShy/article/details/122595252</guid><author>andyTheShy</author><pubDate>Thu, 20 Jan 2022 09:59:47 +0800</pubDate><description><![CDATA[import pandas as pd
import numpy as np

# 构建测试集
df = pd.DataFrame(np.arange(12).reshape(3,4), columns=['a','b','c','d'])
'''
   a  b   c   d
0  0  1   2   3
1  4  5   6   7
2  8  9  10  11
'''

# 删除行
df.drop(2)
df.drop([0,1])

# 删除列
df.drop('a', axis=1)
df]]></description><category></category></item><item><title><![CDATA[pandas表中 根据已有的一列，根据这一列的值并生成新的一列]]></title><link>https://blog.youkuaiyun.com/andyTheShy/article/details/122585122</link><guid>https://blog.youkuaiyun.com/andyTheShy/article/details/122585122</guid><author>andyTheShy</author><pubDate>Wed, 19 Jan 2022 17:00:56 +0800</pubDate><description><![CDATA[def fun(x):
    if x&gt;=0.7:
        return '1'
    else:
        return '0'
```df_res_id['is_same_person']=df_res_id['score'].astype(float).apply(fun)

astype ：类型转换 （将数据由str转为float）


]]></description><category></category></item><item><title><![CDATA[【Python】value_counts(dropna = False) 函数]]></title><link>https://blog.youkuaiyun.com/andyTheShy/article/details/122460506</link><guid>https://blog.youkuaiyun.com/andyTheShy/article/details/122460506</guid><author>andyTheShy</author><pubDate>Wed, 12 Jan 2022 19:25:26 +0800</pubDate><description><![CDATA[value_counts()是一种查看表格某列中有多少个不同值的快捷方法，并计算每个不同值有在该列中有多少重复值。
dropna = False 表示保留 nan，默认情况下 dropna 是true，即默认情况下不包含 nan



s = pd.Series([1,2,3, np.nan, 5])
s.value_counts()
5    1
3    1
2    1
1    1






s.value_counts(dropna = False)



5     1
3     1
2  ]]></description><category></category></item><item><title><![CDATA[什么是反射和字节码对象]]></title><link>https://blog.youkuaiyun.com/andyTheShy/article/details/104333555</link><guid>https://blog.youkuaiyun.com/andyTheShy/article/details/104333555</guid><author>andyTheShy</author><pubDate>Sat, 15 Feb 2020 20:07:05 +0800</pubDate><description><![CDATA[1.什么是"反射"：
它是Java中提供的一种“操作对象”的方式。在运行状态下,通过class文件对象,去使用构造方法,成员变量,成员方法。 之前我们创建对象：
class Demo{
Student stu = new Student();
}
会使Demo类“依赖于”Student类–产生耦合
反射使用另一种方式操作对象，就可以解决这种依赖关系；
　方法有三种:
　　1.类名.class
　　...]]></description><category></category></item><item><title><![CDATA[java斐波那契数列两种实现方法]]></title><link>https://blog.youkuaiyun.com/andyTheShy/article/details/104303557</link><guid>https://blog.youkuaiyun.com/andyTheShy/article/details/104303557</guid><author>andyTheShy</author><pubDate>Thu, 13 Feb 2020 21:51:52 +0800</pubDate><description><![CDATA[java斐波那契数列两种实现方法
import java.util.Scanner;
 
public class Demo {
	public static void main(String args[]){
		Scanner scanner = new Scanner(System.in);
		int n = scanner.nextInt();
		Thread thread = new...]]></description><category></category></item></channel></rss>