随笔分类 - Python
sklearn.make_classification
摘要:sklearn.datasets.make_classification(n_samples=100, n_features=20, n_informative=2, n_redundant=2, n_repeated=0, n_classes=2, n_clusters_per_class=2,
阅读全文
pandas.DataFrame.pivot
摘要:DataFrame.pivot(index=None, columns=None, values=None) 功能:重塑数据(产生一个“pivot”表格)以列值为标准。使用来自索引/列的唯一的值(去除重复值)为轴形成dataframe结果。 为了精细调节控制,可以看和stack/unstack方法有
阅读全文
Figure.savefig
摘要:功能: 将当前图表保存到文件。 参数: fname : 含有文件路径的字符串或Python的文件型对象。图像格式由文件扩展名推断得出,例如, .pdf推断出PDF dpi : 图像分辨率(没英寸点数),默认为100 facecolor,edgecolor : 图像的背景色,默认为"w"(白色) fo
阅读全文
matplotlib pyplot.subplots
摘要:参数: nrows : subplot的行数 ncols : subplot的列数 sharex : 所有subplot应该使用相同的X轴刻度(调节xlim将会影响所有subplot) sharey : 所有subplot应该使用相同的Y轴刻度(调节ylim将会影响所有subplot) subplo
阅读全文
pandas.Index
摘要:class pandas.Index 功能:不可变的ndarray实现一个有序的,可分区的集合。 基本对象存储所有pandas对象的轴标签 参数:data : array-like (1-dimensional) dtype : NumPy dtype (default: object) copy
阅读全文
pandas.concat
摘要:pandas.concat(objs, axis=0, join='outer', join_axes=None, ignore_index=False, keys=None, levels=None,names=None, verify_integrity=False, copy=True) 沿着
阅读全文
pandas.DataFrame.merge
摘要:DataFrame.merge(right, how='inner', on=None, left_on=None, right_on=None, left_index=False, right_index=False,sort=False, suffixes=('_x', '_y'), copy=
阅读全文
pandas.DataFrame.to_csv
摘要:DataFrame.to_csv(path_or_buf=None, sep=', ', na_rep='', float_format=None, columns=None, header=True,index=True, index_label=None, mode='w', encoding=
阅读全文
pandas.date_range
摘要:pandas.date_range(start=None, end=None, periods=None, freq='D', tz=None, normalize=False, name=None,closed=None, **kwargs) 功能:返回一个固定的频率DatetimeIndex,以
阅读全文
pandas.Series.value_counts
摘要:Series.value_counts(normalize=False, sort=True, ascending=False, bins=None, dropna=True) 功能:返回包含唯一值计数的对象。结果对象将按降序排列,以便第一个元素是最常出现的元素。 不包括默认的NA值。 参数:nor
阅读全文
pandas.read_csv / read_table
摘要:pandas.read_csv(filepath_or_buffer, sep=', ', delimiter=None, header='infer', names=None, index_col=None,usecols=None, squeeze=False, prefix=None, man
阅读全文
pandas.DataFrame.dropna
摘要:DataFrame.dropna(axis=0, how='any', thresh=None, subset=None, inplace=False) 功能:根据各标签的值中是否存在缺失数据对轴标签进行过滤,可通过阈值调节对缺失值的容忍度 参数:axis : {0 or ‘index’, 1 or
阅读全文
pandas.DataFrame.fillna
摘要:DataFrame.fillna(value=None, method=None, axis=None, inplace=False, limit=None, downcast=None, **kwargs) 功能:使用指定的方法填充NA / NaN值 参数:value : 变量, 字典, Seri
阅读全文
pandas.DataFrame.rank
摘要:DataFrame.rank(axis=0, method='average', numeric_only=None, na_option='keep', ascending=True, pct=False) 功能:计算沿着轴的数值数据(1到n)。 等值的排名是这些值的排名的平均值。返回从小到大排序
阅读全文
浙公网安备 33010602011771号