No framework, just use numpy to write a wonderful chapter of DNN (Deep Neural Networks)

1. Overview A Logistics Regression can be thought of as a simple neural network consisting of only one hidden layer (Hidden Layer) (as shown in the figure below). However, Logistic Regression is often very sensitive to outliers, and it is difficult to deal with polyphenols. Therefore, people were inspired by human brain nerves and established […]

NumPy data access and functions

CSV file access of data CSV file CSV (Comma-Separated Value) is a common file format used to store batch data. np.savetxt(frame,array,fmt=’%.18e’,delimiter=None) frame: file, string or generator, which can be a .gz or .bz2 compressed file. array: array stored in the file. fmt: The format for writing files, for example: %d %.2f %.18e. delimiter: split the […]

Python data analysis and application NumPy(1) (jupyter notebook)

Create array import numpy as np arr1=np.array([0.3,0.5,4.2])#Create a one-dimensional array arr2=np.array([[3,4,5],[4,2,1]])#Create a two-dimensional array print(arr1) print(arr2) print(type(arr1)) [0.3 0.5 4.2] [[3 4 5] [4 2 1]] <class ‘numpy.ndarray’> #View the basic properties of the array print(arr1.shape)#returns a tuple print(arr1.ndim) print(arr1.dtype)#data type print(arr2.shape) print(arr2.ndim)#Return the dimension of the array print(arr2.dtype) (3,) 1 float64 (twenty three) 2 […]

numpy learning1 (write, create, operate)

Table of Contents external write create array np.array np.zeros np.ones np.full np.arange np.linspace np.eye (np.random.) series np.empty Operate array View array attributes: ndim, shape, size index(point) & slice(piece) Reverse order deformation Splicing Splitting (the inverse of splicing) External writing datas = np.genfromtxt(‘sale_datas.txt’, # file name delimiter=’,’, # delimiter skip_header=1) # Skip the first line datas […]

Numpy implements fast Fourier transform FFT

References: https://zhuanlan.zhihu.com/p/31584464 https://blog.csdn.net/weixin_39591031/article/details/110392352 https://blog.csdn.net/weixin_40146921/article/details/122006305 The NumPy module provides Fast Fourier Transform (FFT) functionality. FFT is an algorithm for efficiently calculating the discrete Fourier transform (DFT) and its inverse transform. It can quickly calculate the expression of time signals in the frequency domain. In NumPy, you can use the numpy.fft module to perform fast Fourier transform. […]

numpy Head and Tail, attributes and underlying data, accelerated operations, binary operations, descriptive statistics, function application

Basic usage This section introduces the basic usage of Pandas data structures. The following code creates the sample data object used in the previous section: In [1]: index = pd.date_range(‘1/1/2000’, periods=8) In [2]: s = pd.Series(np.random.randn(5), index=[‘a’, ‘b’, ‘c’, ‘d’, ‘e ‘]) In [3]: df = pd.DataFrame(np.random.randn(8, 3), index=index, …: columns=[‘A’, ‘B’, ‘C’]) …: n=10 […]

Mathematical functions for array and matrix operations in Numpy

Click “Xiaobai Xue Vision” above and choose to add “star” or “pin“ Heavy stuff, delivered as soon as possible Numpy is a powerful Python calculation library. It provides a wide range of mathematical functions that can perform various operations on arrays and matrices. This article will sort out some basic and commonly used mathematical operations. […]

Solve the problem of inconsistency between pandas.core.frame.DataFrame format data and numpy.ndarray format data resulting in inoperability

Table of Contents Solve the problem of inconsistency between pandas.core.frame.DataFrame format data and numpy.ndarray format data resulting in inoperability Problem Description Solution Summarize ndarray of numpy library What is ndarray? Features of ndarray Create ndarray ndrray properties and methods Indexing and slicing of ndrray Solve the problem of inconsistency between pandas.core.frame.DataFrame format data and numpy.ndarray […]

Data analysis—-Numpy

1. Introduction NumPy is an open source numerical computing extension for Python. This tool can be used to store and process large matrices. It is much more efficient than Python’s own nested list structure (which can also be used to represent matrices). It supports a large number of dimensional array and matrix operations, and also […]