如何解决numpy.ndarray' object is not callable

我用python进行非线性规划时报错numpy.ndarray' object is not callable,有大佬可以帮忙解释一下吗
直到最后一句res=minimize。。。才报错,之前检查过都没有问题

from scipy.optimize import minimize
import numpy as np
def fun():
    v=lambda x:abs((x(1)+0*x(2)+0*x(3)+0*x(4)+0*x(5)+0*x(6)+0*x(7)+0*x(8)+0*x(9)+0*x(10)+0*x(11)+0*x(12)+0*x(13)+0*x(14)))
    return v
def cons():

    # d,e=args
    con=({'type':'eq','fun':lambda x: x(1)-(2171.4/0.85*x(2))},
         {'type': 'eq', 'fun': lambda x: (x(5)*x(6)*89.496/6.28)-x(7)-x(8)},
         {'type': 'eq', 'fun': lambda x: x(9)*x(10)-x(10)*x(11)-x(8)*x(11)},
         {'type': 'eq', 'fun': lambda x: x(12) - x(13)+x(11)},
         {'type': 'eq', 'fun': lambda x: x(10) - 12500*3.1415},
         {'type': 'ineq', 'fun': lambda x: x(6) - x(14)},
         {'type': 'ineq', 'fun': lambda x: x(3) - x(4)-2.45},
         {'type': 'eq', 'fun': lambda x: x(14) - 12.14*3.1415},
         {'type': 'ineq', 'fun': lambda x: x(4) - 2.45},
         {'type': 'ineq', 'fun': lambda x: 97.55 - x(4)},
         {'type': 'ineq', 'fun': lambda x: x(3) },
         {'type': 'ineq', 'fun': lambda x: 95.1 - x(3)},
         {'type': 'ineq', 'fun': lambda x: x(5)-2.45-x(4)},
         {'type': 'ineq', 'fun': lambda x: 100-x(5)}
    )
    return con
a=fun()
b=cons()
# print(b)
x0=np.asarray([3,4,3,2,3,4,3,2,3,4,3,2,3,2])
bounds=((0,None),(0,None),(0,None),(0,None),(0,None),(0,None),(0,None),(0,None),(0,None),(0,None),(0,None),(0,None),(0,None),(0,None))
res=minimize(a,x0,method='SLSQP',constraints=b,bounds=bounds)
print(res)
print(b)

1个回答

Csdn user default icon
上传中...
上传图片
插入图片
抄袭、复制答案,以达到刷声望分或其他目的的行为,在CSDN问答是严格禁止的,一经发现立刻封号。是时候展现真正的技术了!
其他相关推荐
numpy.ndarray' object has no attribute 'show'
已安装:matplotlib,pyparsing,numpy,scipy 源代码: #!/usr/bin/env python # -*- coding:utf-8 -*- from PIL import Image from pylab import* im=array(Image.open('c:\\Python27\\tiananmen.jpg')) im.show() x=[100,100,400,400] y=[200,500,200,500] plot(x,y,'r*') #使用红色星状标记绘制点 plot(x[:2],y[:2])#绘制连接前两个点的线 title('Plotting:"tiananmen.jpg"') #添加标题
python中,opencv图片对象如何转化为f.read()这种类型的bytes
我已经知道从numpy.ndarray (图片)到字节流bytes: x = img.tobytes() 但是我现在想要的是将numpy.ndarray (图片)到f.read()这种类型的bytes ``` with open("1.png","rb") as f: bytes=f.read() ``` 如图, numpy.ndarray (图片)使用tobytes()到字节流bytes是上面的编码格式 f.read()是下面的字节编码方式 ![图片说明](https://img-ask.csdn.net/upload/201905/30/1559228339_868408.jpg)
keras中model.evaluate()报错:'numpy.float64' object is not iterable
``` x_train, x_test, y_train, y_test = train_test_split(x_data, y_data, test_size=0.25) mean = x_train.mean(axis=0) std = x_train.std(axis=0) train_data = (x_train - mean) / std test_data = (x_test - mean) / std model = Sequential([Dense(64, input_shape=(6,)), Activation('relu'), Dense(32), Activation('relu'), Dense(1)]) sgd = keras.optimizers.SGD(lr=0.01, decay=1e-6, momentum=0.9, nesterov=True) model.compile(loss='mean_squared_error', optimizer=sgd) k = model.fit [loss, sgd] = model.evaluate(test_data, y_test, verbose=1) ``` 最后一步不知道哪出了问题。。test_data, y_test都是dataframe啊 TypeError Traceback (most recent call last) <ipython-input-29-3b0767a3c446> in <module> ----> 1 [loss, mse] = model.evaluate(test_data, y_test, verbose=1) TypeError: 'numpy.float64' object is not iterable
python出现 'numpy.dtype' object has no attribute 'is_floating'
模型进行训练的时候在优化器运行部分出现了 'numpy.dtype' object has no attribute 'is_floating' ``` <ipython-input-1-12256e71d6bc> in <module> 260 print('\nPCC training') 261 start = time.time() --> 262 source_acc, target_acc = train_and_evaluate('pcc') 263 sio.savemat('PCC1.mat',{'a':target_y}) 264 end = time.time() <ipython-input-1-12256e71d6bc> in train_and_evaluate(training_mode, num_steps, verbose) 221 y = np.vstack([y0, y1]) 222 pred_loss, coral_loss, cycle_loss, total_loss, classify_labels, pred= loss_function(Fmodel,X,y,True) --> 223 pcc_train_op = tf.train.MomentumOptimizer(learning_rate, 0.9).minimize(lambda:total_loss) 224 #Evaluation 225 correct_label_pred = tf.equal(tf.argmax(classify_labels, 1),tf.argmax(pred_labels,1)) ~/anaconda3/envs/alex/lib/python3.6/site-packages/tensorflow/python/training/optimizer.py in minimize(self, loss, global_step, var_list, gate_gradients, aggregation_method, colocate_gradients_with_ops, name, grad_loss) 401 aggregation_method=aggregation_method, 402 colocate_gradients_with_ops=colocate_gradients_with_ops, --> 403 grad_loss=grad_loss) 404 405 vars_with_grad = [v for g, v in grads_and_vars if g is not None] ~/anaconda3/envs/alex/lib/python3.6/site-packages/tensorflow/python/training/optimizer.py in compute_gradients(self, loss, var_list, gate_gradients, aggregation_method, colocate_gradients_with_ops, grad_loss) 473 # to be executed. 474 with ops.control_dependencies([loss_value]): --> 475 grads = tape.gradient(loss_value, var_list, grad_loss) 476 return list(zip(grads, var_list)) 477 ~/anaconda3/envs/alex/lib/python3.6/site-packages/tensorflow/python/eager/backprop.py in gradient(self, target, sources, output_gradients, unconnected_gradients) 948 flat_targets = [] 949 for t in nest.flatten(target): --> 950 if not t.dtype.is_floating: 951 logging.vlog( 952 logging.WARN, "The dtype of the target tensor must be " AttributeError: 'numpy.dtype' object has no attribute 'is_floating' ``` 一直解决不了
Python用tar.gz文件安装时出现错误:No module named 'numpy.distutils._msvccompiler' in numpy.distutils及Unable to find vcvarsall.bat
系统win10 64位,python版本3.7.4。 在网上下载了scikit-learn-0.22.tar,解压后利用python setup.py install进行安装时报错。 代码如下: ``` PS C:\Users\TH.Liu> cd E:\python\Scripts\scikit-learn-0.22\scikit-learn-0.22 PS E:\python\Scripts\scikit-learn-0.22\scikit-learn-0.22> python setup.py install Partial import of sklearn during the build process. E:\python\lib\distutils\dist.py:274: UserWarning: Unknown distribution option: 'project_urls' warnings.warn(msg) E:\python\lib\distutils\dist.py:274: UserWarning: Unknown distribution option: 'python_requires' warnings.warn(msg) E:\python\lib\distutils\dist.py:274: UserWarning: Unknown distribution option: 'install_requires' warnings.warn(msg) No module named 'numpy.distutils._msvccompiler' in numpy.distutils; trying from distutils Traceback (most recent call last): File "setup.py", line 303, in <module> setup_package() File "setup.py", line 299, in setup_package setup(**metadata) File "E:\python\lib\site-packages\numpy\distutils\core.py", line 137, in setup config = configuration() File "setup.py", line 182, in configuration config.add_subpackage('sklearn') File "E:\python\lib\site-packages\numpy\distutils\misc_util.py", line 1035, in add_subpackage caller_level = 2) File "E:\python\lib\site-packages\numpy\distutils\misc_util.py", line 1004, in get_subpackage caller_level = caller_level + 1) File "E:\python\lib\site-packages\numpy\distutils\misc_util.py", line 941, in _get_configuration_from_setup_py config = setup_module.configuration(*args) File "sklearn\setup.py", line 86, in configuration cythonize_extensions(top_path, config) File "E:\python\Scripts\scikit-learn-0.22\scikit-learn-0.22\sklearn\_build_utils\__init__.py", line 50, in cythonize_extensions basic_check_build() File "E:\python\Scripts\scikit-learn-0.22\scikit-learn-0.22\sklearn\_build_utils\pre_build_helpers.py", line 70, in basic_check_build compile_test_program(code) File "E:\python\Scripts\scikit-learn-0.22\scikit-learn-0.22\sklearn\_build_utils\pre_build_helpers.py", line 40, in compile_test_program extra_postargs=extra_postargs) File "E:\python\lib\distutils\_msvccompiler.py", line 346, in compile self.initialize() File "E:\python\lib\distutils\_msvccompiler.py", line 239, in initialize vc_env = _get_vc_env(plat_spec) File "E:\python\lib\distutils\_msvccompiler.py", line 135, in _get_vc_env raise DistutilsPlatformError("Unable to find vcvarsall.bat") distutils.errors.DistutilsPlatformError: Unable to find vcvarsall.bat ``` 实际上,这俩错误我都在网上找过许多解决方式,但都没有用。下载了VS2010并尝试过在cmd中设置VS90COMNTOOLS =%VS100COMNTOOLS%,依然无效。 抱着最后的希望来这里求助……希望能得到解决。 ———————————————————— 2019.12.17 更新: 在安装了VS2015之后,vcvarsall.bat的问题消失了,剩下的只有: ``` E:\python\lib\distutils\dist.py:274: UserWarning: Unknown distribution option: 'project_urls' warnings.warn(msg) E:\python\lib\distutils\dist.py:274: UserWarning: Unknown distribution option: 'python_requires' warnings.warn(msg) E:\python\lib\distutils\dist.py:274: UserWarning: Unknown distribution option: 'install_requires' warnings.warn(msg) No module named 'numpy.distutils._msvccompiler' in numpy.distutils; trying from distutils ``` 这些问题了。 大家说PowerShell容易出BUG,我换用CMD后依旧如此。 我依旧没有找到这些报错的解决方案,希望得到大佬的帮助!
fatal error: boost/python/numpy.hpp: No such file or directory
哪个大神能解决这个问题,感激不尽!!! ``` fatal error: boost/python/numpy.hpp: No such file or directory ```
Windows下 sklearn:numpy.ufunc has the wrong size
各位大神求指点,我使用ArcGIS10.3自带的Python2.7.8(NumPy 1.7.1,matplotlib 1.3.0)自己去官网下载安装了scipy0.13.3和scikit-learn0.16.0,在编译scikit learn时出现numpy.dtype size问题,还没有运行其他代码,只是导入库就不行了: print('Hello World') # import numpy & scipy import numpy as np from numpy import linalg from numpy.linalg import norm from scipy.spatial.distance import squareform, pdist # import sklearn. import sklearn from sklearn.manifold import TSNE from sklearn.datasets import load_digits from sklearn.preprocessing import scale print "working" ![图片说明](https://img-ask.csdn.net/upload/201601/02/1451704594_425391.png) 新手跪求指点,万分感谢!
numpy.core.multiarray failed to import
# 问题: 使用cmd执行有import cv2 和 numpy的脚本会出现numpy.core.multiarray failed to import ![图片说明](https://img-ask.csdn.net/upload/201708/09/1502268358_642984.jpg) # 一些情况: **环境:** windows 10 python : 3.5.3 opencv-python: 3.3.0 numpy: 1.13.1 在**cmd**运行python,然后import 也会报错 ![图片说明](https://img-ask.csdn.net/upload/201708/09/1502268427_523346.jpg) numpy也是 ![图片说明](https://img-ask.csdn.net/upload/201708/09/1502268454_158067.jpg) **但是** 直接在cp里面是可以import cv2 和 numpy的, IDLE也可以跑程序(cmd里Python fliename.py失败的 ,用IDLE是可以运行的) # 采取过的措施 1. 重装numpy,opencv,乃至换过32位的Python(因为当时用64位的cmd进Python成功import过,但是并不能跑程序,后来还不行了) 2. pip install -U numpy (网上很多这个答案,其实没有用) 请问各路大神这个是什么原因,是环境变量的问题还是什么?
scipy解非线性方程组报错TypeError: 'int' object is not callable
scipy解非线性方程组报错TypeError: 'int' object is not callable。网上说是参数和函数重名的缘故,但貌似我的并没有重名,代码如下: ``` from scipy.integrate import odeint import numpy as np import matplotlib.pyplot as plt from scipy.optimize import root,fsolve def fun(x): for i in range(0,len(x)): x[i] = float(x[i]) fy = np.array([(x[0]*2010**x[1])*np.exp(-1/2(39.9612**2/(x[2]*2010**x[3])+(-75.2303)**2/(x[4]*2010**x[5])-6259)),(x[0]*2011**x[1])*np.exp(-1/2(39.9612**2/(x[2]*2011**x[3])+(-75.2303)**2/(x[4]*2011**x[5])-5958)),(x[0]*2012**x[1])*np.exp(-1/2(41.3866**2/(x[2]*2012**x[3])+(-81.4421)**2/(x[4]*2012**x[5])-2624)),(x[0]*2014**x[1])*np.exp(-1/2(39.9612**2/(x[2]*2014**x[3])+(-75.2303)**2/(x[4]*2014**x[5])-4809)),(x[0]*2015**x[1])*np.exp(-1/2(39.701**2/(x[2]*2015**x[3])+(-84.2187)**2/(x[4]*2015**x[5])-3877)),(x[0]*2017**x[1])*np.exp(-1/2(41.3866**2/(x[2]*2017**x[3])+(-81.4421)**2/(x[4]*2017**x[5])-7381))]) return fy res_fsolve = fsolve(fun,[1,1,1,1,1,1]) print(res_fsolve) ``` 报错内容如下: > TypeError Traceback (most recent call last) > <ipython-input-18-0f6b923ff468> in <module> > 9 fy = np.array([(x[0]*2010**x[1])*np.exp(-1/2(39.9612**2/(x[2]*2010**x[3])+(-75.2303)**2/(x[4]*2010**x[5])-6259)),(x[0]*2011**x[1])*np.exp(-1/2(39.9612**2/(x[2]*2011**x[3])+(-75.2303)**2/(x[4]*2011**x[5])-5958)),(x[0]*2012**x[1])*np.exp(-1/2(41.3866**2/(x[2]*2012**x[3])+(-81.4421)**2/(x[4]*2012**x[5])-2624)),(x[0]*2014**x[1])*np.exp(-1/2(39.9612**2/(x[2]*2014**x[3])+(-75.2303)**2/(x[4]*2014**x[5])-4809)),(x[0]*2015**x[1])*np.exp(-1/2(39.701**2/(x[2]*2015**x[3])+(-84.2187)**2/(x[4]*2015**x[5])-3877)),(x[0]*2017**x[1])*np.exp(-1/2(41.3866**2/(x[2]*2017**x[3])+(-81.4421)**2/(x[4]*2017**x[5])-7381))]) > 10 return fy > ---> 11 res_fsolve = fsolve(fun,[1,1,1,1,1,1]) > 12 print(res_fsolve) > > c:\users\anton\appdata\local\programs\python\python36\lib\site-packages\scipy\optimize\minpack.py in fsolve(func, x0, args, fprime, full_output, col_deriv, xtol, maxfev, band, epsfcn, factor, diag) > 145 'diag': diag} > 146 > --> 147 res = _root_hybr(func, x0, args, jac=fprime, **options) > 148 if full_output: > 149 x = res['x'] > > c:\users\anton\appdata\local\programs\python\python36\lib\site-packages\scipy\optimize\minpack.py in _root_hybr(func, x0, args, jac, col_deriv, xtol, maxfev, band, eps, factor, diag, **unknown_options) > 211 if not isinstance(args, tuple): > 212 args = (args,) > --> 213 shape, dtype = _check_func('fsolve', 'func', func, x0, args, n, (n,)) > 214 if epsfcn is None: > 215 epsfcn = finfo(dtype).eps > > c:\users\anton\appdata\local\programs\python\python36\lib\site-packages\scipy\optimize\minpack.py in _check_func(checker, argname, thefunc, x0, args, numinputs, output_shape) > 24 def _check_func(checker, argname, thefunc, x0, args, numinputs, > 25 output_shape=None): > ---> 26 res = atleast_1d(thefunc(*((x0[:numinputs],) + args))) > 27 if (output_shape is not None) and (shape(res) != output_shape): > 28 if (output_shape[0] != 1): > > <ipython-input-18-0f6b923ff468> in fun(x) > 7 for i in range(0,len(x)): > 8 x[i] = float(x[i]) > ----> 9 fy = np.array([(x[0]*2010**x[1])*np.exp(-1/2(39.9612**2/(x[2]*2010**x[3])+(-75.2303)**2/(x[4]*2010**x[5])-6259)),(x[0]*2011**x[1])*np.exp(-1/2(39.9612**2/(x[2]*2011**x[3])+(-75.2303)**2/(x[4]*2011**x[5])-5958)),(x[0]*2012**x[1])*np.exp(-1/2(41.3866**2/(x[2]*2012**x[3])+(-81.4421)**2/(x[4]*2012**x[5])-2624)),(x[0]*2014**x[1])*np.exp(-1/2(39.9612**2/(x[2]*2014**x[3])+(-75.2303)**2/(x[4]*2014**x[5])-4809)),(x[0]*2015**x[1])*np.exp(-1/2(39.701**2/(x[2]*2015**x[3])+(-84.2187)**2/(x[4]*2015**x[5])-3877)),(x[0]*2017**x[1])*np.exp(-1/2(41.3866**2/(x[2]*2017**x[3])+(-81.4421)**2/(x[4]*2017**x[5])-7381))]) > 10 return fy > 11 res_fsolve = fsolve(fun,[1,1,1,1,1,1]) > > TypeError: 'int' object is not callable
TypeError: 'FileWriter' object is not callable
import tensorflow as tf import tensorlayer as tl import numpy as np class CNNEnv: def __init__(self): # The data, shuffled and split between train and test sets self.x_train, self.y_train, self.x_test, self.y_test = tl.files.load_cifar10_dataset(shape=(-1, 32, 32, 3), plotable=False) # Reorder dimensions for tensorflow self.mean = np.mean(self.x_train, axis=0, keepdims=True) self.std = np.std(self.x_train) self.x_train = (self.x_train - self.mean) / self.std self.x_test = (self.x_test - self.mean) / self.std print('x_train shape:', self.x_train.shape) print('x_test shape:', self.x_test.shape) print('y_train shape:', self.y_train.shape) print('y_test shape:', self.y_test.shape) # For generator self.num_examples = self.x_train.shape[0] self.index_in_epoch = 0 self.epochs_completed = 0 # For wide resnets self.blocks_per_group = 4 self.widening_factor = 4 # Basic info self.batch_num = 64 self.img_row = 32 self.img_col = 32 self.img_channels = 3 self.nb_classes = 10 def next_batch(self, batch_size): """Return the next `batch_size` examples from this data set.""" self.batch_size = batch_size start = self.index_in_epoch self.index_in_epoch += self.batch_size if self.index_in_epoch > self.num_examples: # Finished epoch self.epochs_completed += 1 # Shuffle the data perm = np.arange(self.num_examples) np.random.shuffle(perm) self.x_train = self.x_train[perm] self.y_train = self.y_train[perm] # Start next epoch start = 0 self.index_in_epoch = self.batch_size assert self.batch_size <= self.num_examples end = self.index_in_epoch return self.x_train[start:end], self.y_train[start:end] def reset(self, first): self.first = first if self.first is True: self.sess.close() config = tf.ConfigProto() config.gpu_options.allow_growth = True self.sess = tf.InteractiveSession(config=config) def step(self): def zero_pad_channels(x, pad=0): """ Function for Lambda layer """ pattern = [[0, 0], [0, 0], [0, 0], [pad - pad // 2, pad // 2]] return tf.pad(x, pattern) def residual_block(x, count, nb_filters=16, subsample_factor=1): prev_nb_channels = x.outputs.get_shape().as_list()[3] if subsample_factor > 1: subsample = [1, subsample_factor, subsample_factor, 1] # shortcut: subsample + zero-pad channel dim name_pool = 'pool_layer' + str(count) shortcut = tl.layers.PoolLayer(x, ksize=subsample, strides=subsample, padding='VALID', pool=tf.nn.avg_pool, name=name_pool) else: subsample = [1, 1, 1, 1] # shortcut: identity shortcut = x if nb_filters > prev_nb_channels: name_lambda = 'lambda_layer' + str(count) shortcut = tl.layers.LambdaLayer( shortcut, zero_pad_channels, fn_args={'pad': nb_filters - prev_nb_channels}, name=name_lambda) name_norm = 'norm' + str(count) y = tl.layers.BatchNormLayer(x, decay=0.999, epsilon=1e-05, is_train=True, name=name_norm) name_conv = 'conv_layer' + str(count) y = tl.layers.Conv2dLayer(y, act=tf.nn.relu, shape=[3, 3, prev_nb_channels, nb_filters], strides=subsample, padding='SAME', name=name_conv) name_norm_2 = 'norm_second' + str(count) y = tl.layers.BatchNormLayer(y, decay=0.999, epsilon=1e-05, is_train=True, name=name_norm_2) prev_input_channels = y.outputs.get_shape().as_list()[3] name_conv_2 = 'conv_layer_second' + str(count) y = tl.layers.Conv2dLayer(y, act=tf.nn.relu, shape=[3, 3, prev_input_channels, nb_filters], strides=[1, 1, 1, 1], padding='SAME', name=name_conv_2) name_merge = 'merge' + str(count) out = tl.layers.ElementwiseLayer([y, shortcut], combine_fn=tf.add, name=name_merge) return out # Placeholders learning_rate = tf.placeholder(tf.float32) img = tf.placeholder(tf.float32, shape=[self.batch_num, 32, 32, 3]) labels = tf.placeholder(tf.int32, shape=[self.batch_num, ]) x = tl.layers.InputLayer(img, name='input_layer') x = tl.layers.Conv2dLayer(x, act=tf.nn.relu, shape=[3, 3, 3, 16], strides=[1, 1, 1, 1], padding='SAME', name='cnn_layer_first') for i in range(0, self.blocks_per_group): nb_filters = 16 * self.widening_factor count = i x = residual_block(x, count, nb_filters=nb_filters, subsample_factor=1) for i in range(0, self.blocks_per_group): nb_filters = 32 * self.widening_factor if i == 0: subsample_factor = 2 else: subsample_factor = 1 count = i + self.blocks_per_group x = residual_block(x, count, nb_filters=nb_filters, subsample_factor=subsample_factor) for i in range(0, self.blocks_per_group): nb_filters = 64 * self.widening_factor if i == 0: subsample_factor = 2 else: subsample_factor = 1 count = i + 2*self.blocks_per_group x = residual_block(x, count, nb_filters=nb_filters, subsample_factor=subsample_factor) x = tl.layers.BatchNormLayer(x, decay=0.999, epsilon=1e-05, is_train=True, name='norm_last') x = tl.layers.PoolLayer(x, ksize=[1, 8, 8, 1], strides=[1, 8, 8, 1], padding='VALID', pool=tf.nn.avg_pool, name='pool_last') x = tl.layers.FlattenLayer(x, name='flatten') x = tl.layers.DenseLayer(x, n_units=self.nb_classes, act=tf.identity, name='fc') output = x.outputs ce = tf.reduce_mean(tf.nn.sparse_softmax_cross_entropy_with_logits(output, labels)) cost = ce tf.summary.histogram('cost',cost) correct_prediction = tf.equal(tf.cast(tf.argmax(output, 1), tf.int32), labels) acc = tf.reduce_mean(tf.cast(correct_prediction, tf.float32)) tf.summary.histogram('acc',acc) train_params = x.all_params train_op = tf.train.GradientDescentOptimizer( learning_rate, use_locking=False).minimize(cost, var_list=train_params) merged = tf.summary.merge_all() writer1 = tf.summary.FileWriter('train/',self.sess.graph) #先执行 self.sess.run(tf.global_variables_initializer()) tf.global_variables_initializer() for i in range(10): batch = self.next_batch(self.batch_num) feed_dict = {img: batch[0], labels: batch[1], learning_rate: 0.01} feed_dict.update(x.all_drop) tp, l, ac,me1 = self.sess.run([train_op, cost, acc,merged], feed_dict=feed_dict) writer1(me1,i) print('loss', l) print('acc', ac) writer1.close() a = CNNEnv() a.reset(first=False) a.step()
缺少 numpy.random.common
我使用python的tkinter编写了一个程序,用pyinstaller编译之后,程序提示 failed to execute script 文件名 错误提示: no module named 'numpy.random.common' 可是我重新pip numpy模块还是不好用 请问怎么解决? ``` #!/usr/bin/python # -- coding: utf-8 -- import fnmatch #选择文件的关键词 import os from time import sleep from tkinter import * import tkinter.filedialog #弹出选择路径的库 import tkinter.messagebox import fnmatch #选择文件的关键词 import re import pandas as pd import docx import pickle import codecs import string import shutil from win32com import client as wc def matchdocname(str1,root,i,list_box): if str1 in os.path.splitext(i)[0]: list_box.insert(END, root+"/"+i) def matchdoccontent(str1,root,i,list_box): if i.endswith('txt'): #当文件为txt时 with open(os.path.join(root, i) ,'r') as fp: errors='' aa=fp.read() if str1 in aa : list_box.insert(END, root+"/"+i) if i.endswith('xls') or i.endswith('xlsx') : #当文件为excel时 df=pd.read_excel(os.path.join(root, i)) df=df.values for k in df: for j in k: j=str(j) if str1 in j: list_box.insert(END, root+"/"+i) if i.endswith('docx'): #当文件为.docx时 word = wc.Dispatch('Word.Application') doc = word.Documents.Open(os.path.join(root, i)) newname=os.path.join(root, i)+"(translate txt)" doc.SaveAs(newname,4) doc.Close() word.Quit() with open(newname ,'r') as fp: errors='' aa=fp.read() if str1 in aa : list_box.insert(END, root+"/"+i) os.remove(newname) if i.endswith('doc'): #当文件为.doc时 word = wc.Dispatch('Word.Application') doc = word.Documents.Open(os.path.join(root, i)) newname=os.path.join(root, i)+"(translate txt)" doc.SaveAs(newname,4) doc.Close() word.Quit() with open(newname ,'r') as fp: errors='' aa=fp.read() if str1 in aa : list_box.insert(END, root+"/"+i) os.remove(newname) #删掉这个临时文件 def left(): if not entry.get() :#检测关键词输入框是否为空 tkinter.messagebox.showerror("提示信息:","出现以下错误:\n关键词不能为空")#弹出警告框 return #如果为空不再执行 if var1.get()==0 and var2.get()==0 : tkinter.messagebox.showerror("提示信息:","出现以下错误:\n匹配项不能为空")#弹出警告框 return #如果为空不再执行 list_box.delete(0,END) path = tkinter.filedialog.askdirectory()#弹出选择路径的窗口,path为获取的路径 path_list = os.walk(path)#获取一个列表目录的对象 for root, dirs, files in path_list: #print root, dirs, files if var1.get()==1 and var2.get()==0: #当只匹配文件名时 list_box.insert(END, '文件名') for i in files: matchdocname(entry.get(),root,i,list_box) elif var1.get()==0 and var2.get()==1: #当只匹配文件内容时 list_box.insert(END, '文件内容') for i in files: matchdoccontent(entry.get(),root,i,list_box) elif var1.get()==1 and var2.get()==1: #当既匹配文件名又匹配文件内容时 list_box.insert(END, '文件名') for i in files: matchdocname(entry.get(),root,i,list_box) list_box.insert(END, '--------------') list_box.insert(END, '文件内容') for i in files: matchdoccontent(entry.get(),root,i,list_box) def func2(e): if not list_box.curselection():#取双击的坐标52 return path = list_box.get(list_box.curselection(),last=None) os.startfile(path) def nagea(e): error = '' tdir = dirs.get(dirs.curselection()) if os.path.isfile(tdir): #如果是文件 则打开 os.startfile(tdir) elif os.path.isdir(tdir): #如果是文件夹 则调用dols setDirAndGo() def wenjianshu(): dirs.delete(0,END) path = tkinter.filedialog.askdirectory()#弹出选择路径的窗口,path为获取的路径 doLS1(path) #双击时调用,双击时,设置背景色为红色,并调用doLS函数打开所选文件 def setDirAndGo(ev=None): last = cwd.get() dirs.config(selectbackground='red') check = dirs.get(dirs.curselection()) if not check: check = os.curdir cwd.set(check) doLS() #实现更新目录的核心函数 def doLS(ev=None): error = '' tdir = cwd.get() if not tdir:tdir=os.curdir #若路径输入错误,或者打开的是文件,而不是目录,则更新错误提示信息 if not os.path.exists(tdir): error = os.getcwd()+'\\'+tdir + ':未找到文件' elif not os.path.isdir(tdir): error = os.getcwd()+'\\'+tdir + ':未找到目录' if error: cwd.set(error) top2.update() sleep(1) cwd.set(os.curdir) dirs.config(selectbackground='LightSkyBlue') top2.update() return cwd.set(os.getcwd()+'\\'+tdir) top2.update() dirlist = os.listdir(tdir)#os.listdir() 方法用于返回指定的文件夹包含的文件或文件夹的名字的列表。 dirlist.sort() os.chdir(tdir)#os.chdir() 方法用于改变当前工作目录到指定的路径。 #更新界面上方标签内容 dirl.config(text=os.getcwd()) top2.update() dirs.delete(0,END) dirs.insert(END,os.pardir)#os.chdir(os.pardir) 切换到上级目录 即将上级目录.. 插入到dirs对象中 #把选定目录的文件或文件夹的名字的列表依次插入到dirs对象中 for eachFile in dirlist: dirs.insert(END,eachFile) cwd.set(os.curdir) dirs.config(selectbackground='LightSkyBlue') def doLS1(tdir): error = '' if not tdir:tdir=os.curdir #若路径输入错误,或者打开的是文件,而不是目录,则更新错误提示信息 if not os.path.exists(tdir): error = os.getcwd()+'\\'+tdir + ':未找到文件' elif not os.path.isdir(tdir): error = os.getcwd()+'\\'+tdir + ':未找到目录' if error: cwd.set(error) top2.update() sleep(1) cwd.set(os.curdir) dirs.config(selectbackground='LightSkyBlue') top2.update() return cwd.set(os.getcwd()+'\\'+tdir) top2.update() dirlist = os.listdir(tdir)#os.listdir() 方法用于返回指定的文件夹包含的文件或文件夹的名字的列表。 dirlist.sort os.chdir(tdir)#os.chdir() 方法用于改变当前工作目录到指定的路径。 #更新界面上方标签内容 dirl.config(text=os.getcwd()) top2.update() dirs.delete(0,END) dirs.insert(END,os.pardir)#os.chdir(os.pardir) 切换到上级目录 即将上级目录.. 插入到dirs对象中 #把选定目录的文件或文件夹的名字的列表依次插入到dirs对象中 for eachFile in dirlist: dirs.insert(END,eachFile) cwd.set(os.curdir) dirs.config(selectbackground='LightSkyBlue') top2 = Tk() top2.title('营销集约管控中心-文件管理') top2.geometry('+50+50')#窗口大小,窗口位置 cwd = StringVar(top2) var=IntVar() dirl = Label(top2,fg = 'BLUE',font = ('Helvetica',18,'bold')) dirl.pack() dirfm = Frame(top2) dirs = Listbox(dirfm,height=25,width=90) #通过使用List的bind()方法,将鼠标双击事件绑定,并调用setDirAndGo函数 dirs.bind('<Double-1>',nagea) dirs.pack(side=LEFT,fill=BOTH) list_box = Listbox(dirfm,height=25,width=90) list_box.bind('<Double-Button-1>',func2) #绑定一个双击触发事件 list_box.pack(side=LEFT,fill=BOTH)#显示列表框 dirfm.pack() #第二个框架bfm,放置按钮 bfm = Frame(top2) open1 = Button(bfm,text='文件树',command=wenjianshu,activeforeground='white',activebackground='blue') open1.pack(side=LEFT) bfm.pack(side=LEFT,fill=BOTH) #多选框插件 var1 = tkinter.IntVar() # 用来储存下面勾选项1中返回的0或1 var2 = tkinter.IntVar() # 用来储存下面勾选项2中返回的0或1 button2=tkinter.Checkbutton(top2,text="匹配文件内容",variable=var2,onvalue=1,offvalue=0) button2.pack(side=RIGHT,fill=BOTH) button1=tkinter.Checkbutton(top2,text="匹配文件名",variable=var1,onvalue=1,offvalue=0) button1.pack(side=RIGHT,fill=BOTH) #按钮控件 entry = Entry()#输入框实例化 entry.pack(side=RIGHT,fill=BOTH)#输入框 button2=Button(top2,text="关键字",command=left) button2.pack(side=RIGHT,fill=BOTH) if __name__ =='__main__': #设定初始目录为桌面 mainloop() ```
numpy.array()打开图片时像素点表示问题
在应用numpy.array()打开图片 代码如下: ``` i = Image.open('images/numbers/0.1.png') iar = np.array(i, dtype='int64') print(iar) ``` 输出结果中大部分为 [[[255 255 255 255] ...... (即alpha数值有表示出来) 而另一张图片,可能就会输出 [[[255 255 255] ...... (即alpha数值没有表示出来) 想请教一下这是为什么呢,有没有什么办法可以把它们统一起来吗?
pyinstaller打包处理的程序用不了
warn-xxx.txt文件的信息如下,求大佬处理 This file lists modules PyInstaller was not able to find. This does not necessarily mean this module is required for running you program. Python and Python 3rd-party packages include a lot of conditional or optional module. For example the module 'ntpath' only exists on Windows, whereas the module 'posixpath' only exists on Posix systems. Types if import: * top-level: imported at the top-level - look at these first * conditional: imported within an if-statement * delayed: imported from within a function * optional: imported within a try-except-statement IMPORTANT: Do NOT post this list to the issue-tracker. Use it as a basis for yourself tracking down the missing module. Thanks! missing module named pyimod03_importers - imported by PyInstaller.loader.pyimod02_archive (delayed, conditional), c:\program files\python37\lib\site-packages\PyInstaller\loader\rthooks\pyi_rth_pkgres.py (top-level) missing module named 'pkg_resources.extern.pyparsing' - imported by pkg_resources._vendor.packaging.requirements (top-level), pkg_resources._vendor.packaging.markers (top-level) missing module named 'com.sun' - imported by pkg_resources._vendor.appdirs (delayed, conditional, optional) missing module named com - imported by pkg_resources._vendor.appdirs (delayed) missing module named win32api - imported by distutils.msvccompiler (optional), pkg_resources._vendor.appdirs (delayed, conditional, optional) missing module named win32com.shell - imported by pkg_resources._vendor.appdirs (delayed, conditional, optional) missing module named _uuid - imported by uuid (optional) missing module named netbios - imported by uuid (delayed) missing module named win32wnet - imported by uuid (delayed) missing module named __builtin__ - imported by numpy.core.numerictypes (conditional), numpy.core.numeric (conditional), numpy.lib.function_base (conditional), numpy.lib._iotools (conditional), numpy.ma.core (conditional), numpy.distutils.misc_util (delayed, conditional), numpy (conditional), pymysql._compat (conditional), pkg_resources._vendor.pyparsing (conditional), setuptools._vendor.pyparsing (conditional) missing module named ordereddict - imported by pkg_resources._vendor.pyparsing (optional), setuptools._vendor.pyparsing (optional) missing module named StringIO - imported by PyInstaller.lib.modulegraph._compat (conditional), PyInstaller.lib.modulegraph.zipio (conditional), setuptools._vendor.six (conditional), numpy.lib.utils (delayed, conditional), numpy.lib.format (delayed, conditional), numpy.testing._private.utils (conditional), six (conditional), urllib3.packages.six (conditional), requests.compat (conditional), selenium.webdriver.remote.webelement (optional), pkg_resources._vendor.six (conditional) missing module named _scproxy - imported by urllib.request (conditional) missing module named 'macholib.MachO' - imported by PyInstaller.depend.dylib (delayed), PyInstaller.depend.bindepend (delayed), PyInstaller.utils.osx (top-level) missing module named macholib - imported by PyInstaller.depend.dylib (delayed, conditional) missing module named _pkgutil - imported by PyInstaller.lib.modulegraph.modulegraph (delayed, optional) missing module named dis3 - imported by PyInstaller.lib.modulegraph._compat (conditional) missing module named urllib.pathname2url - imported by urllib (conditional), PyInstaller.lib.modulegraph._compat (conditional) missing module named pyimod00_crypto_key - imported by PyInstaller.loader.pyimod02_archive (delayed, optional) missing module named thread - imported by numpy.core.arrayprint (conditional, optional), PyInstaller.loader.pyimod02_archive (conditional) missing module named 'macholib.dyld' - imported by PyInstaller.depend.bindepend (delayed) missing module named 'macholib.mach_o' - imported by PyInstaller.depend.bindepend (delayed) missing module named Crypto - imported by PyInstaller.building.makespec (delayed, conditional, optional) missing module named win32ctypes.core._time - imported by win32ctypes.core (top-level), win32ctypes.pywin32.win32api (top-level) missing module named win32ctypes.core._system_information - imported by win32ctypes.core (top-level), win32ctypes.pywin32.win32api (top-level) missing module named win32ctypes.core._resource - imported by win32ctypes.core (top-level), win32ctypes.pywin32.win32api (top-level) missing module named win32ctypes.core._dll - imported by win32ctypes.core (top-level), win32ctypes.pywin32.win32api (top-level) missing module named win32ctypes.core._common - imported by win32ctypes.core (top-level), win32ctypes.pywin32.win32api (top-level), win32ctypes.pywin32.win32cred (top-level) missing module named win32ctypes.core._authentication - imported by win32ctypes.core (top-level), win32ctypes.pywin32.win32cred (top-level) missing module named cffi - imported by win32ctypes.core (optional) missing module named UserDict - imported by PyInstaller.compat (conditional), pytz.lazy (optional) missing module named multiprocessing.set_start_method - imported by multiprocessing (top-level), multiprocessing.spawn (top-level) missing module named multiprocessing.get_start_method - imported by multiprocessing (top-level), multiprocessing.spawn (top-level) missing module named multiprocessing.TimeoutError - imported by multiprocessing (top-level), multiprocessing.pool (top-level) missing module named multiprocessing.get_context - imported by multiprocessing (top-level), multiprocessing.pool (top-level), multiprocessing.managers (top-level), multiprocessing.sharedctypes (top-level) missing module named multiprocessing.BufferTooShort - imported by multiprocessing (top-level), multiprocessing.connection (top-level) missing module named multiprocessing.AuthenticationError - imported by multiprocessing (top-level), multiprocessing.connection (top-level) missing module named pkg_resources.extern.packaging - imported by pkg_resources.extern (top-level), pkg_resources (top-level) missing module named pkg_resources.extern.appdirs - imported by pkg_resources.extern (top-level), pkg_resources (top-level) missing module named 'pkg_resources.extern.six.moves' - imported by pkg_resources (top-level), pkg_resources._vendor.packaging.requirements (top-level) missing module named pkg_resources.extern.six - imported by pkg_resources.extern (top-level), pkg_resources (top-level) missing module named 'multiprocessing.forking' - imported by c:\program files\python37\lib\site-packages\PyInstaller\loader\rthooks\pyi_rth_multiprocessing.py (optional) missing module named resource - imported by posix (top-level), E:\yxrj\dingzhi\cj\231.py (top-level) missing module named posix - imported by os (conditional, optional), E:\yxrj\dingzhi\cj\231.py (top-level) missing module named _posixsubprocess - imported by subprocess (conditional), multiprocessing.util (delayed), E:\yxrj\dingzhi\cj\231.py (top-level) missing module named readline - imported by cmd (delayed, conditional, optional), code (delayed, conditional, optional), pdb (delayed, optional), E:\yxrj\dingzhi\cj\231.py (top-level) excluded module named _frozen_importlib - imported by importlib (optional), importlib.abc (optional), PyInstaller.loader.pyimod02_archive (delayed, conditional), E:\yxrj\dingzhi\cj\231.py (top-level) missing module named _frozen_importlib_external - imported by importlib._bootstrap (delayed), importlib (optional), importlib.abc (optional), E:\yxrj\dingzhi\cj\231.py (top-level) missing module named _winreg - imported by platform (delayed, optional), numpy.distutils.cpuinfo (delayed, conditional, optional), requests.utils (delayed, conditional, optional), selenium.webdriver.firefox.firefox_binary (delayed, optional), E:\yxrj\dingzhi\cj\231.py (top-level), pkg_resources._vendor.appdirs (delayed) missing module named java - imported by platform (delayed), E:\yxrj\dingzhi\cj\231.py (top-level) missing module named 'java.lang' - imported by platform (delayed, optional), xml.sax._exceptions (conditional), E:\yxrj\dingzhi\cj\231.py (top-level) missing module named vms_lib - imported by platform (delayed, conditional, optional), E:\yxrj\dingzhi\cj\231.py (top-level) missing module named termios - imported by tty (top-level), getpass (optional), E:\yxrj\dingzhi\cj\231.py (top-level) missing module named urllib.getproxies_environment - imported by urllib (conditional), requests.compat (conditional) missing module named urllib.proxy_bypass_environment - imported by urllib (conditional), requests.compat (conditional) missing module named urllib.proxy_bypass - imported by urllib (conditional), requests.compat (conditional) missing module named urllib.getproxies - imported by urllib (conditional), requests.compat (conditional) missing module named urllib.unquote_plus - imported by urllib (conditional), requests.compat (conditional) missing module named urllib.quote_plus - imported by urllib (conditional), requests.compat (conditional) missing module named urllib.unquote - imported by urllib (conditional), requests.compat (conditional) missing module named urllib.urlencode - imported by urllib (optional), urllib3.packages.rfc3986.compat (optional), requests.compat (conditional) missing module named urllib.quote - imported by urllib (optional), urllib3.packages.rfc3986.compat (optional), requests.compat (conditional) missing module named grp - imported by shutil (optional), tarfile (optional), pathlib (delayed), distutils.archive_util (optional), E:\yxrj\dingzhi\cj\231.py (top-level) missing module named 'org.python' - imported by pickle (optional), xml.sax (delayed, conditional), setuptools.sandbox (conditional), E:\yxrj\dingzhi\cj\231.py (top-level) missing module named org - imported by copy (optional), E:\yxrj\dingzhi\cj\231.py (top-level) missing module named pwd - imported by posixpath (delayed, conditional), shutil (optional), tarfile (optional), http.server (delayed, optional), webbrowser (delayed), pathlib (delayed, conditional, optional), distutils.util (delayed, conditional), distutils.archive_util (optional), netrc (delayed, conditional), getpass (delayed), E:\yxrj\dingzhi\cj\231.py (top-level) missing module named urllib2 - imported by numpy.lib._datasource (delayed, conditional), requests.compat (conditional), selenium.webdriver.common.utils (delayed, optional), selenium.webdriver.common.service (delayed, optional) missing module named urlparse - imported by numpy.lib._datasource (delayed, conditional), requests.compat (conditional), selenium.webdriver.remote.remote_connection (optional) runtime module named urllib3.packages.six.moves - imported by http.client (top-level), urllib3.connectionpool (top-level), urllib3.util.response (top-level), 'urllib3.packages.six.moves.urllib' (top-level), urllib3.response (top-level), urllib3.util.queue (top-level) missing module named 'OpenSSL.crypto' - imported by urllib3.contrib.pyopenssl (delayed) missing module named 'cryptography.x509' - imported by urllib3.contrib.pyopenssl (delayed, optional) missing module named 'cryptography.hazmat' - imported by pymysql._auth (optional), urllib3.contrib.pyopenssl (top-level) missing module named cryptography - imported by pymysql._auth (optional), urllib3.contrib.pyopenssl (top-level), requests (optional) missing module named OpenSSL - imported by urllib3.contrib.pyopenssl (top-level) missing module named 'backports.ssl_match_hostname' - imported by setuptools.ssl_support (optional), urllib3.packages.ssl_match_hostname (optional) missing module named brotli - imported by urllib3.util.request (optional), urllib3.response (optional) missing module named "'urllib3.packages.six.moves.urllib'.parse" - imported by urllib3.request (top-level), urllib3.poolmanager (top-level) missing module named Queue - imported by urllib3.util.queue (conditional) missing module named httplib - imported by selenium.webdriver.safari.webdriver (optional), selenium.webdriver.blackberry.webdriver (optional), selenium.webdriver.webkitgtk.webdriver (optional) missing module named cStringIO - imported by selenium.webdriver.firefox.firefox_profile (optional) missing module named copy_reg - imported by numpy.core (conditional), soupsieve.util (conditional), cStringIO (top-level) missing module named 'backports.functools_lru_cache' - imported by soupsieve.util (conditional) missing module named iconv_codec - imported by bs4.dammit (optional) missing module named cchardet - imported by bs4.dammit (optional) missing module named lxml - imported by bs4.builder._lxml (top-level) missing module named 'html5lib.treebuilders' - imported by bs4.builder._html5lib (optional) missing module named 'html5lib.constants' - imported by bs4.builder._html5lib (top-level) missing module named html5lib - imported by bs4.builder._html5lib (top-level) missing module named Cookie - imported by requests.compat (conditional) missing module named cookielib - imported by requests.compat (conditional) missing module named simplejson - imported by pandas.util._print_versions (delayed, conditional, optional), requests.compat (optional) missing module named socks - imported by urllib3.contrib.socks (optional) missing module named _dummy_threading - imported by dummy_threading (optional) missing module named ConfigParser - imported by numpy.distutils.system_info (conditional), numpy.distutils.npy_pkg_config (conditional), pymysql.optionfile (conditional) missing module named scipy - imported by numpy.testing._private.nosetester (delayed, conditional), pandas.core.missing (delayed) missing module named numexpr - imported by pandas.core.computation.expressions (conditional), pandas.core.computation.engines (delayed) missing module named 'scipy.stats' - imported by pandas.plotting._matplotlib.hist (delayed), pandas.plotting._matplotlib.misc (delayed, conditional), pandas.core.nanops (delayed, conditional) missing module named 'scipy.signal' - imported by pandas.core.window (delayed, conditional) missing module named commands - imported by numpy.distutils.cpuinfo (conditional) missing module named setuptools.extern.packaging - imported by setuptools.extern (top-level), setuptools.dist (top-level), setuptools.command.egg_info (top-level) missing module named 'setuptools.extern.six' - imported by setuptools (top-level), setuptools.extension (top-level) missing module named setuptools.extern.six.moves.filterfalse - imported by setuptools.extern.six.moves (top-level), setuptools.dist (top-level), setuptools.msvc (top-level) missing module named setuptools.extern.six.moves.filter - imported by setuptools.extern.six.moves (top-level), setuptools.dist (top-level), setuptools.ssl_support (top-level), setuptools.command.py36compat (top-level) missing module named _manylinux - imported by setuptools.pep425tags (delayed, optional) missing module named wincertstore - imported by setuptools.ssl_support (delayed, optional) missing module named backports - imported by setuptools.ssl_support (optional) missing module named 'setuptools._vendor.six.moves' - imported by 'setuptools._vendor.six.moves' (top-level) missing module named 'setuptools.extern.pyparsing' - imported by setuptools._vendor.packaging.requirements (top-level), setuptools._vendor.packaging.markers (top-level) missing module named 'setuptools.extern.packaging.version' - imported by setuptools.msvc (top-level) missing module named setuptools.extern.six.moves.map - imported by setuptools.extern.six.moves (top-level), setuptools.dist (top-level), setuptools.command.easy_install (top-level), setuptools.sandbox (top-level), setuptools.package_index (top-level), setuptools.ssl_support (top-level), setuptools.command.egg_info (top-level), setuptools.namespaces (top-level) runtime module named setuptools.extern.six.moves - imported by setuptools.dist (top-level), setuptools.py33compat (top-level), setuptools.command.easy_install (top-level), setuptools.sandbox (top-level), setuptools.command.setopt (top-level), setuptools.package_index (top-level), setuptools.ssl_support (top-level), setuptools.command.egg_info (top-level), setuptools.command.py36compat (top-level), setuptools.namespaces (top-level), setuptools.msvc (top-level), 'setuptools._vendor.six.moves' (top-level) missing module named setuptools.extern.six - imported by setuptools.extern (top-level), setuptools.monkey (top-level), setuptools.dist (top-level), setuptools.extern.six.moves (top-level), setuptools.py33compat (top-level), setuptools.config (top-level), setuptools.command.easy_install (top-level), setuptools.sandbox (top-level), setuptools.py27compat (top-level), setuptools.package_index (top-level), setuptools.wheel (top-level), setuptools.command.egg_info (top-level), setuptools.command.sdist (top-level), setuptools.command.bdist_egg (top-level), setuptools.unicode_utils (top-level), setuptools.glob (top-level), setuptools.command.develop (top-level) missing module named 'numpy_distutils.cpuinfo' - imported by numpy.f2py.diagnose (delayed, conditional, optional) missing module named 'numpy_distutils.fcompiler' - imported by numpy.f2py.diagnose (delayed, conditional, optional) missing module named 'numpy_distutils.command' - imported by numpy.f2py.diagnose (delayed, conditional, optional) missing module named numpy_distutils - imported by numpy.f2py.diagnose (delayed, optional) missing module named 'nose.plugins' - imported by numpy.testing._private.noseclasses (top-level), numpy.testing._private.nosetester (delayed) missing module named numpy.core.number - imported by numpy.core (delayed), numpy.testing._private.utils (delayed) missing module named numpy.core.signbit - imported by numpy.core (delayed), numpy.testing._private.utils (delayed) missing module named numpy.core.float64 - imported by numpy.core (delayed), numpy.testing._private.utils (delayed) missing module named numpy.core.integer - imported by numpy.core (top-level), numpy.fft.helper (top-level) missing module named numpy.core.conjugate - imported by numpy.core (top-level), numpy.fft.pocketfft (top-level) missing module named numpy.core.sign - imported by numpy.core (top-level), numpy.linalg.linalg (top-level) missing module named numpy.core.divide - imported by numpy.core (top-level), numpy.linalg.linalg (top-level) missing module named numpy.core.object_ - imported by numpy.core (top-level), numpy.linalg.linalg (top-level) missing module named numpy.core.geterrobj - imported by numpy.core (top-level), numpy.linalg.linalg (top-level) missing module named numpy.core.sqrt - imported by numpy.core (top-level), numpy.linalg.linalg (top-level), numpy.fft.pocketfft (top-level) missing module named numpy.core.add - imported by numpy.core (top-level), numpy.linalg.linalg (top-level) missing module named numpy.core.complexfloating - imported by numpy.core (top-level), numpy.linalg.linalg (top-level) missing module named numpy.core.inexact - imported by numpy.core (top-level), numpy.linalg.linalg (top-level) missing module named numpy.core.cdouble - imported by numpy.core (top-level), numpy.linalg.linalg (top-level) missing module named numpy.core.csingle - imported by numpy.core (top-level), numpy.linalg.linalg (top-level) missing module named numpy.core.double - imported by numpy.core (top-level), numpy.linalg.linalg (top-level) missing module named numpy.core.single - imported by numpy.core (top-level), numpy.linalg.linalg (top-level) missing module named numpy.core.float32 - imported by numpy.core (top-level), numpy.testing._private.utils (top-level) missing module named numpy.core.intp - imported by numpy.core (top-level), numpy.testing._private.utils (top-level), numpy.linalg.linalg (top-level) missing module named numpy.eye - imported by numpy (delayed), numpy.core.numeric (delayed) missing module named dummy_thread - imported by numpy.core.arrayprint (conditional, optional) missing module named 'nose.util' - imported by numpy.testing._private.noseclasses (top-level) missing module named nose - imported by numpy.testing._private.utils (delayed, optional), numpy.testing._private.decorators (delayed), numpy.testing._private.noseclasses (top-level) missing module named win32pdh - imported by numpy.testing._private.utils (delayed, conditional) missing module named __svn_version__ - imported by numpy.f2py.__version__ (optional) missing module named numarray - imported by numpy.distutils.system_info (delayed, conditional, optional) missing module named Numeric - imported by numpy.distutils.system_info (delayed, conditional, optional) missing module named win32con - imported by distutils.msvccompiler (optional) missing module named _curses - imported by curses (top-level), curses.has_key (top-level) missing module named pytest - imported by numpy._pytesttester (delayed), pandas.util._tester (delayed, optional), pandas.util.testing (delayed, conditional, optional) missing module named future_builtins - imported by numpy.lib.npyio (conditional) missing module named cpickle - imported by numpy.compat.py3k (conditional) missing module named pickle5 - imported by numpy.compat.py3k (conditional, optional) missing module named numpy.histogramdd - imported by numpy (delayed), numpy.lib.twodim_base (delayed) missing module named numpy.lib.i0 - imported by numpy.lib (top-level), numpy.dual (top-level) missing module named 'scipy.sparse' - imported by pandas.core.sparse.scipy_sparse (delayed), pandas.core.arrays.sparse (delayed), pandas.core.dtypes.common (delayed, conditional, optional) missing module named botocore - imported by pandas.io.s3 (delayed) missing module named 'pyarrow.parquet' - imported by pandas.io.parquet (delayed) missing module named pyarrow - imported by pandas.io.feather_format (delayed) missing module named contextmanager - imported by dateutil.tz.tz (optional) runtime module named six.moves - imported by dateutil.tz.tz (top-level), dateutil.tz.win (top-level), dateutil.rrule (top-level) missing module named six.moves.range - imported by six.moves (top-level), dateutil.rrule (top-level) missing module named dateutil.tz.tzfile - imported by dateutil.tz (top-level), dateutil.zoneinfo (top-level) missing module named dateutil.tz.tzlocal - imported by dateutil.tz (top-level), dateutil.rrule (top-level) missing module named dateutil.tz.tzutc - imported by dateutil.tz (top-level), dateutil.rrule (top-level) missing module named PyQt4 - imported by pandas.io.clipboard.clipboards (delayed, optional), pandas.io.clipboard (delayed, conditional, optional) missing module named PyQt5 - imported by pandas.io.clipboard.clipboards (delayed, optional), pandas.io.clipboard (delayed, conditional, optional) missing module named qtpy - imported by pandas.io.clipboard.clipboards (delayed, optional), pandas.io.clipboard (delayed, conditional, optional) missing module named 'sqlalchemy.types' - imported by pandas.io.sql (delayed, conditional) missing module named 'sqlalchemy.schema' - imported by pandas.io.sql (delayed, conditional) missing module named sqlalchemy - imported by pandas.io.sql (delayed, conditional, optional) missing module named tables - imported by pandas.io.pytables (delayed, conditional) missing module named xlwt - imported by pandas.io.excel._xlwt (delayed) missing module named xlsxwriter - imported by pandas.io.excel._xlsxwriter (delayed) missing module named 'openpyxl.styles' - imported by pandas.io.excel._openpyxl (delayed) missing module named 'openpyxl.style' - imported by pandas.io.excel._openpyxl (delayed) missing module named openpyxl - imported by pandas.io.excel._openpyxl (delayed, conditional) missing module named xlrd - imported by pandas.io.excel._xlrd (delayed) missing module named 'odf.namespaces' - imported by pandas.io.excel._odfreader (delayed) missing module named 'odf.table' - imported by pandas.io.excel._odfreader (delayed) missing module named 'odf.opendocument' - imported by pandas.io.excel._odfreader (delayed) missing module named odf - imported by pandas.io.excel._odfreader (delayed) missing module named matplotlib - imported by pandas.plotting._matplotlib.boxplot (top-level), pandas.plotting._matplotlib.compat (delayed, optional), pandas.plotting._matplotlib.timeseries (delayed), pandas.plotting._matplotlib.core (delayed), pandas.io.formats.style (optional) missing module named 'matplotlib.pyplot' - imported by pandas.plotting._matplotlib.style (delayed), pandas.plotting._matplotlib.tools (delayed), pandas.plotting._matplotlib.core (delayed), pandas.plotting._matplotlib.timeseries (delayed), pandas.plotting._matplotlib.boxplot (delayed), pandas.plotting._matplotlib.hist (delayed), pandas.plotting._matplotlib.misc (delayed), pandas.plotting._matplotlib (delayed), pandas.io.formats.style (optional), pandas.util.testing (delayed) missing module named numpy.array - imported by numpy (top-level), numpy.ma.core (top-level), numpy.ma.extras (top-level), numpy.ma.mrecords (top-level), numpy.ctypeslib (top-level) missing module named numpy.recarray - imported by numpy (top-level), numpy.ma.mrecords (top-level) missing module named numpy.ndarray - imported by numpy (top-level), numpy.ma.core (top-level), numpy.ma.extras (top-level), numpy.ma.mrecords (top-level), numpy.ctypeslib (top-level), pandas.compat.numpy.function (top-level) missing module named numpy.dtype - imported by numpy (top-level), numpy.ma.mrecords (top-level), numpy.ctypeslib (top-level) missing module named numpy.bool_ - imported by numpy (top-level), numpy.ma.core (top-level), numpy.ma.mrecords (top-level) missing module named 'matplotlib.ticker' - imported by pandas.plotting._matplotlib.converter (top-level), pandas.plotting._matplotlib.tools (top-level), pandas.plotting._matplotlib.core (delayed) missing module named 'matplotlib.table' - imported by pandas.plotting._matplotlib.tools (top-level) missing module named 'matplotlib.colors' - imported by pandas.plotting._matplotlib.style (top-level) missing module named 'matplotlib.cm' - imported by pandas.plotting._matplotlib.style (top-level) missing module named 'matplotlib.patches' - imported by pandas.plotting._matplotlib.misc (top-level) missing module named 'matplotlib.lines' - imported by pandas.plotting._matplotlib.misc (top-level) missing module named 'matplotlib.axes' - imported by pandas.plotting._matplotlib.core (delayed) missing module named 'matplotlib.units' - imported by pandas.plotting._matplotlib.converter (top-level) missing module named 'matplotlib.transforms' - imported by pandas.plotting._matplotlib.converter (top-level) missing module named 'matplotlib.dates' - imported by pandas.plotting._matplotlib.converter (top-level) missing module named numpy.expand_dims - imported by numpy (top-level), numpy.ma.core (top-level) missing module named numpy.iscomplexobj - imported by numpy (top-level), numpy.ma.core (top-level) missing module named numpy.amin - imported by numpy (top-level), numpy.ma.core (top-level) missing module named numpy.amax - imported by numpy (top-level), numpy.ma.core (top-level) missing module named 'IPython.core' - imported by pandas.io.formats.printing (delayed, conditional) missing module named IPython - imported by pandas.io.formats.printing (delayed) missing module named s3fs - imported by pandas.io.common (delayed, optional) missing module named sets - imported by pytz.tzinfo (optional) missing module named numpy.random.randn - imported by numpy.random (top-level), pandas.util.testing (top-level) missing module named numpy.random.rand - imported by numpy.random (top-level), pandas.util.testing (top-level) missing module named hypothesis - imported by pandas.util._tester (delayed, optional) missing module named 'lxml.etree' - imported by pandas.io.html (delayed) missing module named 'lxml.html' - imported by pandas.io.html (delayed)
django 设置一个初值化后一直不变的变量
1.mysql数据库有10w左右数据,想取出来规范为numpy.ndarray类型。如果用sql语句全部取出来速度太慢,看网上说可能要半小时或者以上。不知道有什么更快取出的方法。<br > 2.取出来后想在项目运行整个期间都存在。在views.py用def函数的话岂不是每一次界面submit都需要调用该def函数用sql语句取出来。
python用matplotlib显示图片出错
源代码: import os from PIL import Image import matplotlib.pyplot as plt img = Image.open(os.path.join('', 'Testsample' + '.png')) plt.figure("Image") # 图像窗口名称 plt.imshow(img) plt.axis('on') # 关掉坐标轴为 off plt.title('image') # 图像题目 plt.show() 去掉plt.show(),就没有错误 错误提示: AttributeError: 'numpy.ndarray' object has no attribute 'mask'![图片说明](https://img-ask.csdn.net/upload/201803/19/1521467447_98280.png)
关于归一化和numpy.log处理数据的疑问
在数据挖掘中, 有对数据进行归一化处理,比如StandardNormalization, 这种归一化处理的 好处是对异常的离散数值有很好的效果, 而numpy.log 可以对一些离散的异常数值有这种处理, 经过这种log处理后,得到的直方图更接近高斯分布, 我的问题是: 1. 我在网上看到一些大数据挖掘方面的资料,利用LogisticRegressor, 并没有对数据进行 归一化处理, 这种归一化是否不一定必须的 ? 2. 如果采用了 StandardNormalization 这种归一化处理,是否也相当于采用了Log处理的效果,而且数值被限定在更小的范围之内? 3. 数据挖掘中,如果用到 LogisticRegressor这种算法,是否直接对那些离散值直接进行StandardNormalization处理,不用采用Log处理?
求助大神,numy ndarray转为list
网上搜了很多 tolist会将ndarry转成一行 而不是逗号隔开的行 ,求助大神 <class 'numpy.ndarray'> [[0.02407997 0.0230331 0.02451023 ... 0.02099599 0.02108407 0.02127302] [0.02408507 0.0229293 0.0220789 ... 0.02095065 0.02102397 0.02120139] [0.02436025 0.02317223 0.02230555 ... 0.02115807 0.02124699 0.02143753] ... [0.02267 0.02292304 0.02246058 ... 0.0210516 0.02107221 0.02120132] [0.02299755 0.02345366 0.02326958 ... 0.0211791 0.02126773 0.02145817] [0.02459634 0.02318546 0.02258372 ... 0.02113681 0.02122526 0.02141533]] 想转换成 <class 'list'> [[0.02407997 0.0230331 0.02451023 ... 0.02099599 0.02108407 0.02127302], [0.02408507 0.0229293 0.0220789 ... 0.02095065 0.02102397 0.02120139], [0.02436025 0.02317223 0.02230555 ... 0.02115807 0.02124699 0.02143753], ... [0.02267 0.02292304 0.02246058 ... 0.0210516 0.02107221 0.02120132], [0.02299755 0.02345366 0.02326958 ... 0.0211791 0.02126773 0.02145817], [0.02459634 0.02318546 0.02258372 ... 0.02113681 0.02122526 0.02141533]]
请教朋友们,python中numpy.min(dataset[:,j]) 这句话是什么意思?
各位大神好,问题是这样的: 最近在看K-means聚类算法的python实现版本,看到了一个朋友写的程序,下面是选取数据集dataSet的k个初始中心的函数 ``` 各位大神好,问题是这样的: 最近在看K-means聚类算法的python实现版本,看到了一个朋友写的程序,下面是选取数据集dataSet的k个初始中心的函数 18 def randCent(dataSet, k): 19 n = shape(dataSet)[1] 20 centroids = mat(zeros((k,n))) 21 for j in range(n): 22 minJ = min(dataSet[:,j]) 23 rangeJ = float(max(array(dataSet)[:,j]) - minJ) 24 centroids[:,j] = minJ + rangeJ * random.rand(k,1) 25 return centroids 其中第22行没看明白minJ = min(dataSet[:,j]) dataSet是一个mat类型的numpy矩阵。 dataSet[:,j] 是什么意思啊?请教各位朋友,十分感谢 ``` 其中第22行没看明白minJ = min(dataSet[:,j]) dataSet是一个mat类型的numpy矩阵。 dataSet[:,j] 是什么意思啊?请教各位朋友,十分感谢
mxnet自动安装numpy 1.14.6,导致 importError(无法加载multiarray模块)
本人需要安装mxnet,而pip安装时,会自动卸载新版本numpy,重新安装1.14.6版本numpy,安装后numpy报错。于是本人卸载了mxnet和numpy进行测试。单独安装1.14.6版本numpy出错: windows平台,安装正常:pip install -i https://pypi.tuna.tsinghua.edu.cn/simple numpy==1.14.6 import numpy出错:![图片说明](https://img-ask.csdn.net/upload/201905/19/1558227199_638733.png) 新版本numpy正常安装后可以使用,但numpy 1.14.6出错。我的python是3.6版本的。请问这是什么原因?或者如何让mxnet不使用numpy 1.14.6?(经测试,安装1.16.3版本numpy后,mxnet也无法使用)
相见恨晚的超实用网站
搞学习 知乎:www.zhihu.com 简答题:http://www.jiandati.com/ 网易公开课:https://open.163.com/ted/ 网易云课堂:https://study.163.com/ 中国大学MOOC:www.icourse163.org 网易云课堂:study.163.com 哔哩哔哩弹幕网:www.bilibili.com 我要自学网:www.51zxw
花了20分钟,给女朋友们写了一个web版群聊程序
参考博客 [1]https://www.byteslounge.com/tutorials/java-ee-html5-websocket-example
爬虫福利二 之 妹子图网MM批量下载
爬虫福利一:27报网MM批量下载    点击 看了本文,相信大家对爬虫一定会产生强烈的兴趣,激励自己去学习爬虫,在这里提前祝:大家学有所成! 目标网站:妹子图网 环境:Python3.x 相关第三方模块:requests、beautifulsoup4 Re:各位在测试时只需要将代码里的变量 path 指定为你当前系统要保存的路径,使用 python xxx.py 或IDE运行即可。
字节跳动视频编解码面经
引言 本文主要是记录一下面试字节跳动的经历。 三四月份投了字节跳动的实习(图形图像岗位),然后hr打电话过来问了一下会不会opengl,c++,shador,当时只会一点c++,其他两个都不会,也就直接被拒了。 七月初内推了字节跳动的提前批,因为内推没有具体的岗位,hr又打电话问要不要考虑一下图形图像岗,我说实习投过这个岗位不合适,不会opengl和shador,然后hr就说秋招更看重基础。我当时
Java学习的正确打开方式
在博主认为,对于入门级学习java的最佳学习方法莫过于视频+博客+书籍+总结,前三者博主将淋漓尽致地挥毫于这篇博客文章中,至于总结在于个人,实际上越到后面你会发现学习的最好方式就是阅读参考官方文档其次就是国内的书籍,博客次之,这又是一个层次了,这里暂时不提后面再谈。博主将为各位入门java保驾护航,各位只管冲鸭!!!上天是公平的,只要不辜负时间,时间自然不会辜负你。 何谓学习?博主所理解的学习,它
程序员必须掌握的核心算法有哪些?
由于我之前一直强调数据结构以及算法学习的重要性,所以就有一些读者经常问我,数据结构与算法应该要学习到哪个程度呢?,说实话,这个问题我不知道要怎么回答你,主要取决于你想学习到哪些程度,不过针对这个问题,我稍微总结一下我学过的算法知识点,以及我觉得值得学习的算法。这些算法与数据结构的学习大多数是零散的,并没有一本把他们全部覆盖的书籍。下面是我觉得值得学习的一些算法以及数据结构,当然,我也会整理一些看过
大学四年自学走来,这些私藏的实用工具/学习网站我贡献出来了
大学四年,看课本是不可能一直看课本的了,对于学习,特别是自学,善于搜索网上的一些资源来辅助,还是非常有必要的,下面我就把这几年私藏的各种资源,网站贡献出来给你们。主要有:电子书搜索、实用工具、在线视频学习网站、非视频学习网站、软件下载、面试/求职必备网站。 注意:文中提到的所有资源,文末我都给你整理好了,你们只管拿去,如果觉得不错,转发、分享就是最大的支持了。 一、电子书搜索 对于大部分程序员...
linux系列之常用运维命令整理笔录
本博客记录工作中需要的linux运维命令,大学时候开始接触linux,会一些基本操作,可是都没有整理起来,加上是做开发,不做运维,有些命令忘记了,所以现在整理成博客,当然vi,文件操作等就不介绍了,慢慢积累一些其它拓展的命令,博客不定时更新 顺便拉下票,我在参加csdn博客之星竞选,欢迎投票支持,每个QQ或者微信每天都可以投5票,扫二维码即可,http://m234140.nofollow.ax.
比特币原理详解
一、什么是比特币 比特币是一种电子货币,是一种基于密码学的货币,在2008年11月1日由中本聪发表比特币白皮书,文中提出了一种去中心化的电子记账系统,我们平时的电子现金是银行来记账,因为银行的背后是国家信用。去中心化电子记账系统是参与者共同记账。比特币可以防止主权危机、信用风险。其好处不多做赘述,这一层面介绍的文章很多,本文主要从更深层的技术原理角度进行介绍。 二、问题引入 假设现有4个人...
Python 基础(一):入门必备知识
目录1 标识符2 关键字3 引号4 编码5 输入输出6 缩进7 多行8 注释9 数据类型10 运算符10.1 常用运算符10.2 运算符优先级 1 标识符 标识符是编程时使用的名字,用于给变量、函数、语句块等命名,Python 中标识符由字母、数字、下划线组成,不能以数字开头,区分大小写。 以下划线开头的标识符有特殊含义,单下划线开头的标识符,如:_xxx ,表示不能直接访问的类属性,需通过类提供
这30个CSS选择器,你必须熟记(上)
关注前端达人,与你共同进步CSS的魅力就是让我们前端工程师像设计师一样进行网页的设计,我们能轻而易举的改变颜色、布局、制作出漂亮的影音效果等等,我们只需要改几行代码,不需...
国产开源API网关项目进入Apache孵化器:APISIX
点击蓝色“程序猿DD”关注我回复“资源”获取独家整理的学习资料!近日,又有一个开源项目加入了这个Java开源界大名鼎鼎的Apache基金会,开始进行孵化器。项目名称:AP...
程序员接私活怎样防止做完了不给钱?
首先跟大家说明一点,我们做 IT 类的外包开发,是非标品开发,所以很有可能在开发过程中会有这样那样的需求修改,而这种需求修改很容易造成扯皮,进而影响到费用支付,甚至出现做完了项目收不到钱的情况。 那么,怎么保证自己的薪酬安全呢? 我们在开工前,一定要做好一些证据方面的准备(也就是“讨薪”的理论依据),这其中最重要的就是需求文档和验收标准。一定要让需求方提供这两个文档资料作为开发的基础。之后开发
网页实现一个简单的音乐播放器(大佬别看。(⊙﹏⊙))
今天闲着无事,就想写点东西。然后听了下歌,就打算写个播放器。 于是乎用h5 audio的加上js简单的播放器完工了。 欢迎 改进 留言。 演示地点跳到演示地点 html代码如下`&lt;!DOCTYPE html&gt; &lt;html&gt; &lt;head&gt; &lt;title&gt;music&lt;/title&gt; &lt;meta charset="utf-8"&gt
Python十大装B语法
Python 是一种代表简单思想的语言,其语法相对简单,很容易上手。不过,如果就此小视 Python 语法的精妙和深邃,那就大错特错了。本文精心筛选了最能展现 Python 语法之精妙的十个知识点,并附上详细的实例代码。如能在实战中融会贯通、灵活使用,必将使代码更为精炼、高效,同时也会极大提升代码B格,使之看上去更老练,读起来更优雅。 1. for - else 什么?不是 if 和 else 才
数据库优化 - SQL优化
前面一篇文章从实例的角度进行数据库优化,通过配置一些参数让数据库性能达到最优。但是一些“不好”的SQL也会导致数据库查询变慢,影响业务流程。本文从SQL角度进行数据库优化,提升SQL运行效率。 判断问题SQL 判断SQL是否有问题时可以通过两个表象进行判断: 系统级别表象 CPU消耗严重 IO等待严重 页面响应时间过长
2019年11月中国大陆编程语言排行榜
2019年11月2日,我统计了某招聘网站,获得有效程序员招聘数据9万条。针对招聘信息,提取编程语言关键字,并统计如下: 编程语言比例 rank pl_ percentage 1 java 33.62% 2 c/c++ 16.42% 3 c_sharp 12.82% 4 javascript 12.31% 5 python 7.93% 6 go 7.25% 7
通俗易懂地给女朋友讲:线程池的内部原理
餐厅的约会 餐盘在灯光的照耀下格外晶莹洁白,女朋友拿起红酒杯轻轻地抿了一小口,对我说:“经常听你说线程池,到底线程池到底是个什么原理?”我楞了一下,心里想女朋友今天是怎么了,怎么突然问出这么专业的问题,但做为一个专业人士在女朋友面前也不能露怯啊,想了一下便说:“我先给你讲讲我前同事老王的故事吧!” 大龄程序员老王 老王是一个已经北漂十多年的程序员,岁数大了,加班加不动了,升迁也无望,于是拿着手里
经典算法(5)杨辉三角
杨辉三角 是经典算法,这篇博客对它的算法思想进行了讲解,并有完整的代码实现。
编写Spring MVC控制器的14个技巧
本期目录 1.使用@Controller构造型 2.实现控制器接口 3.扩展AbstractController类 4.为处理程序方法指定URL映射 5.为处理程序方法指定HTTP请求方法 6.将请求参数映射到处理程序方法 7.返回模型和视图 8.将对象放入模型 9.处理程序方法中的重定向 10.处理表格提交和表格验证 11.处理文件上传 12.在控制器中自动装配业务类 ...
腾讯算法面试题:64匹马8个跑道需要多少轮才能选出最快的四匹?
昨天,有网友私信我,说去阿里面试,彻底的被打击到了。问了为什么网上大量使用ThreadLocal的源码都会加上private static?他被难住了,因为他从来都没有考虑过这个问题。无独有偶,今天笔者又发现有网友吐槽了一道腾讯的面试题,我们一起来看看。 腾讯算法面试题:64匹马8个跑道需要多少轮才能选出最快的四匹? 在互联网职场论坛,一名程序员发帖求助到。二面腾讯,其中一个算法题:64匹
面试官:你连RESTful都不知道我怎么敢要你?
面试官:了解RESTful吗? 我:听说过。 面试官:那什么是RESTful? 我:就是用起来很规范,挺好的 面试官:是RESTful挺好的,还是自我感觉挺好的 我:都挺好的。 面试官:… 把门关上。 我:… 要干嘛?先关上再说。 面试官:我说出去把门关上。 我:what ?,夺门而去 文章目录01 前言02 RESTful的来源03 RESTful6大原则1. C-S架构2. 无状态3.统一的接
求小姐姐抠图竟遭白眼?痛定思痛,我决定用 Python 自力更生!
点击蓝色“Python空间”关注我丫加个“星标”,每天一起快乐的学习大家好,我是 Rocky0429,一个刚恰完午饭,正在用刷网页浪费生命的蒟蒻...一堆堆无聊八卦信息的网页内容慢慢使我的双眼模糊,一个哈欠打出了三斤老泪,就在此时我看到了一张图片:是谁!是谁把我女朋友的照片放出来的!awsl!太好看了叭...等等,那个背景上的一堆鬼画符是什么鬼?!真是看不下去!叔叔婶婶能忍,隔壁老王的三姨妈的四表...
为啥国人偏爱Mybatis,而老外喜欢Hibernate/JPA呢?
关于SQL和ORM的争论,永远都不会终止,我也一直在思考这个问题。昨天又跟群里的小伙伴进行了一番讨论,感触还是有一些,于是就有了今天这篇文。 声明:本文不会下关于Mybatis和JPA两个持久层框架哪个更好这样的结论。只是摆事实,讲道理,所以,请各位看官勿喷。 一、事件起因 关于Mybatis和JPA孰优孰劣的问题,争论已经很多年了。一直也没有结论,毕竟每个人的喜好和习惯是大不相同的。我也看
SQL-小白最佳入门sql查询一
不要偷偷的查询我的个人资料,即使你再喜欢我,也不要这样,真的不好;
项目中的if else太多了,该怎么重构?
介绍 最近跟着公司的大佬开发了一款IM系统,类似QQ和微信哈,就是聊天软件。我们有一部分业务逻辑是这样的 if (msgType = "文本") { // dosomething } else if(msgType = "图片") { // doshomething } else if(msgType = "视频") { // doshomething } else { // doshom...
致 Python 初学者
欢迎来到“Python进阶”专栏!来到这里的每一位同学,应该大致上学习了很多 Python 的基础知识,正在努力成长的过程中。在此期间,一定遇到了很多的困惑,对未来的学习方向感到迷茫。我非常理解你们所面临的处境。我从2007年开始接触 python 这门编程语言,从2009年开始单一使用 python 应对所有的开发工作,直至今天。回顾自己的学习过程,也曾经遇到过无数的困难,也曾经迷茫过、困惑过。开办这个专栏,正是为了帮助像我当年一样困惑的 Python 初学者走出困境、快速成长。希望我的经验能真正帮到你
“狗屁不通文章生成器”登顶GitHub热榜,分分钟写出万字形式主义大作
一、垃圾文字生成器介绍 最近在浏览GitHub的时候,发现了这样一个骨骼清奇的雷人项目,而且热度还特别高。 项目中文名:狗屁不通文章生成器 项目英文名:BullshitGenerator 根据作者的介绍,他是偶尔需要一些中文文字用于GUI开发时测试文本渲染,因此开发了这个废话生成器。但由于生成的废话实在是太过富于哲理,所以最近已经被小伙伴们给玩坏了。 他的文风可能是这样的: 你发现,...
程序员:我终于知道post和get的区别
是一个老生常谈的话题,然而随着不断的学习,对于以前的认识有很多误区,所以还是需要不断地总结的,学而时习之,不亦说乎
《程序人生》系列-这个程序员只用了20行代码就拿了冠军
你知道的越多,你不知道的越多 点赞再看,养成习惯GitHub上已经开源https://github.com/JavaFamily,有一线大厂面试点脑图,欢迎Star和完善 前言 这一期不算《吊打面试官》系列的,所有没前言我直接开始。 絮叨 本来应该是没有这期的,看过我上期的小伙伴应该是知道的嘛,双十一比较忙嘛,要值班又要去帮忙拍摄年会的视频素材,还得搞个程序员一天的Vlog,还要写BU...
相关热词 c# plc s1200 c#里氏转换原则 c# 主界面 c# do loop c#存为组套 模板 c# 停掉协程 c# rgb 读取图片 c# 图片颜色调整 最快 c#多张图片上传 c#密封类与密封方法
立即提问