hhh_ml

导航

随笔分类 -  python第三方库使用

pandas库中的sample函数解释
摘要:Pandas>>sample()函数 随机选取若干行功能说明有时候我们只需要数据集中的一部分,并不需要全部的数据。这个时候我们就要对数据集进行随机的抽样。pandas中自带有抽样的方法。功能相似:numpy.random.choice函数名:DataFrame.sample(n=None,frac= 阅读全文

posted @ 2021-02-04 21:03 hhh_ml 阅读(2591) 评论(0) 推荐(1)

pandas库dateframe介绍
摘要:Pandas>>sample()函数 随机选取若干行功能说明有时候我们只需要数据集中的一部分,并不需要全部的数据。这个时候我们就要对数据集进行随机的抽样。pandas中自带有抽样的方法。功能相似:numpy.random.choice函数名:DataFrame.sample(n=None,frac= 阅读全文

posted @ 2021-02-04 21:00 hhh_ml 阅读(265) 评论(0) 推荐(0)

python-pyplot库中legend函数即参数使用
摘要:1.图例legend基础语法及用法 legend语法参数如下: matplotlib.pyplot.legend(*args, **kwargs) Keyword Description loc Location code string, or tuple (see below).图例所有figur 阅读全文

posted @ 2021-02-04 20:59 hhh_ml 阅读(3846) 评论(0) 推荐(0)

pandas库dateframe介绍
摘要:javascript:void(0); ”的onclick =“ copyCnblogsCode(这)”标题=“复制代码”> <IMG SRC =” //common.cnblogs.com/images/copycode.gif” ALT =“复制代码”> </一> </跨度> </ div> < 阅读全文

posted @ 2021-02-04 20:54 hhh_ml 阅读(139) 评论(0) 推荐(0)

matplotlib库基本使用
摘要:Matplotlib.pyplot 常用方法 Matplotlib.pyplot 常用方法 1、介绍 Matplotlib 是一个 Python 的 2D绘图库,它以各种硬拷贝格式和跨平台的交互式环境生成出版质量级别的图形。通过 Matplotlib,开发者可以仅需要几行代码,便可以生成绘图, 直方 阅读全文

posted @ 2021-02-04 20:51 hhh_ml 阅读(206) 评论(0) 推荐(0)

numpy中reindex函数用法
摘要:import numpy as np import pandas as pd from pandas import Series, DataFrame np.random.seed(666) # series reindex s1 = Series([1, 2, 3, 4], index=['A', 阅读全文

posted @ 2021-02-04 20:49 hhh_ml 阅读(327) 评论(0) 推荐(0)

numpy中reindex函数用法
摘要:import numpy as np import pandas as pd from pandas import Series, DataFrame np.random.seed(666) # series reindex s1 = Series([1, 2, 3, 4], index=['A', 阅读全文

posted @ 2021-02-04 20:47 hhh_ml 阅读(164) 评论(0) 推荐(0)

pandas库loc和iloc函数解释
摘要:oc与iloc函数 loc函数 import pandas as pd import numpy # 导入数据 df = pd.read_csv(filepath_or_buffer="D://movie.csv") df_new = df.set_index(["country"]) df_new 阅读全文

posted @ 2021-02-04 20:46 hhh_ml 阅读(528) 评论(0) 推荐(0)

python-matplotlib库label函数参数即使用
摘要:```python import matplotlib.pyplot as plt import numpy as np # 定义数据 x = np.linspace(-3, 3, 50) y1 = 2*x + 1 y2 = x**2 # 定义figure plt.figure() # 绘图(x,y 阅读全文

posted @ 2021-02-04 20:45 hhh_ml 阅读(2397) 评论(0) 推荐(0)