
matplotlib
文章平均质量分 97
luoganttcc
微信:luogantt2
展开
-
Matplotlib散点图:如何为每个数据点添加标签
【代码】Matplotlib散点图:如何为每个数据点添加标签。原创 2025-03-22 12:19:22 · 999 阅读 · 0 评论 -
python 数组基本用法
b=list(range(5))b[0, 1, 2, 3, 4] #列表区别a=np.arange(5)aarray([0, 1, 2, 3, 4])# 矩阵生成一个1*24的矩阵,在将她变成2*3*4的数体c=np.arange(24).reshape(2,3,4)cOut[301]: array([[[ 0, 1, 2, 3], [ 4, 5, 6,原创 2017-04-06 08:47:16 · 473 阅读 · 0 评论 -
zip() python
zip 就是zip函数接受任意多个(包括0个和1个)序列作为参数,返回一个tuple列表x = [1, 2, 3]y = [4, 5, 6]z = [7, 8, 9]list(zip(x, y, z))Out[33]: [(1, 4, 7), (2, 5, 8), (3, 6, 9)]x = [1, 2, 3]y = [4, 5, 6, 7]list(zip(x, y, z))Out[36]:转载 2017-04-06 10:08:46 · 319 阅读 · 0 评论 -
线性回归和岭回归
我近半年每个月所写博客的数量# -*- coding: utf-8 -*-"""Created on Fri Sep 1 18:23:07 2017@author: Administrator"""from sklearn import linear_modelimport numpy as npimport matplotlib.pyplot as plty=np.array([1转载 2017-09-01 19:06:05 · 870 阅读 · 0 评论 -
python 多项式拟合
import numpy as npfrom scipy.optimize import leastsqimport pylab as plimport matplotlib.pyplot as plt x = np.arange(1, 17, 1)y = np.array([4.00, 6.40, 8.00, 8.80, 9.22, 9.50, 9.70, 9.86, 10.00, 10.转载 2017-11-09 17:35:55 · 10795 阅读 · 5 评论 -
python绘制三维图
from matplotlib import pyplot as pltimport numpy as npfrom mpl_toolkits.mplot3d import Axes3Dfig = plt.figure()ax = Axes3D(fig)X = np.arange(-4, 4, 0.25)Y = np.arange(-4, 4, 0.25)X, Y = np.mes转载 2018-01-10 15:22:12 · 4983 阅读 · 0 评论