Read about wes mckinney python for data analysis, The latest news, videos, and discussion topics about wes mckinney python for data analysis from alibabacloud.com
More important Ndarray object properties in an array of numpy:Ndarray.ndim: The number of dimensions (that is, the number of array axes) of the array, equal to the rank. The most common are two-dimensional arrays (matrices). ndarray.itemsize: The byte size of each element in the array. For example, an array with an element type of Float64 Itemsiz property value of 8 (float64 consumes 64 bits, each byte is 8, so 64/8, takes 8 bytes), and An array with an element type of complex32 the Item proper
in the number rangePrint(Np.random.randint (1,10,3))#The first two digits are the range, followed by a random number of outputs#RANDN Standard dynamically generated random numbersPrint(Np.random.randn ())#0.2021606168747088Print(Np.random.randn (2,4))#normal random number of two rows of four columns" "[ [ -0.43522053 0.288716 1.5751424-0.89094638] [ -1.12602864 1.27198812-0.4784293 1.90768013]" "#choice randomly generates a random number within an arrayPrint(Np.random.choice ([10,20,30]))#rando
with mappings Here are just a few of the features, please refer to the official documentation for details.1Frame9 =PD. DataFrame ({2 'Item':[' Ball','Mug','Pen','Pencil','Ashtray'],3 'Color':[' White','Red','Green','Black','Yellow']4 })5 Print(FRAME9)6Price = {7 ' Ball': 5.56,8 'Mug': 4.20,9 'Bottle1': 1.30,Ten 'Scissors': 3.41, One 'Pen': 1.30, A 'Pencil': 0.56, - 'Ashtray': 2.75 - } theframe9[' Price'] = frame9['Item'].map (Price) # here is the correspondi
???IndexP.asfreq (' M ', ' Start ') #将年度数据转换为月度的形式, converted to the month of the yearP.asfreq (' M ', ' End ') #将年度数据转换为月度的形式, converted to December of the yearP1=PD. Period (' freq= ', ' A-jun ')P1.asfreq (' m ', ' Start ') #Period (' 2015-07 ', ' m ')P1.asfreq (' m ', ' End ') #Period (' 2016-06 ', ' m ')P2=PD. Period (' 2016-09 ', ' M ')P2.asfreq (' A-jun ') #2016年9月进行频率转换, equivalent to 2017 years in the time frequency ending in JuneRng=pd.period_range (' 2006 ', ' freq= ', ' A-dec ')Ts=ser
Operating system: Windowspython:3.5Welcome to join the Learning Exchange QQ Group: 657341423
The previous section describes the library of data analysis and mining needs, the most important of which is pandas,matplotlib.Pandas: Mainly on data analysis, calculation and statistics, such as the average, square bad.Matplot
b c D-a nan-nan nan nan-nan-nan-nan nan-nan-nan-nan NaNThe parameters of the Reindex are as follows:Deletes the item series on the specified axis (index)in []: obj = Series ([1,2,3,4],index=['a','b','C','D']) in [113]: objout[113]:a1b2C3D4dtype:int64in [[Obj1]: = Obj.drop ('C') in [115]: obj1out[115]:a1b2D4Dtype:int64DataFrameDelete a single index rowIn [109]: frameout[109]: class score0 Chinese 1201 Math 1302 English in[+]: obj = frame.drop (0) in [111]: objout[111]:
This article has shared with you about the Python data processing related content as well as the key explanation, to this knowledge point interested friend may refer to the study.
Numpy, Pandas is the Python data processing often used in two frames, are written in C language, so the speed of operation. Matplotlib is a
said that the interactive way right-click and hold the date will be dynamically expanded or shrunk, actually do it, no effect ...plt.show ()>>>AA AAPL GE IBM JNJ MSFT PEP SPX XOM1990-02-01 4.98 7.86 2.87 16.79 4.27 0.51 6.04 328.79 6.121990-02-02 5.04 8.00 2.87 16.89 4.37 0.51 6.09 330.92 6.241990-02-05 5.07 8.18 2.87 17.32 4.34 0.51 6.05 331.85 6.251990-02-06 5.01 8.12 2.88 17.56 4.32 0.51 6.15 329.66 6.231990-02-07 5.04 7.77 2.91 17.93 4.38 0.51 6.17 333.75 6.33AAPL MSFT XOM1990-02-01 7.86 0
the string object method Split () method splits the string:The Strip () method removes whitespace and line breaks:Split () in combination with strip () using:The "+" symbol allows you to concatenate multiple strings together:The join () method is also the connection string, comparing it to the "+" symbol:The In keyword determines whether a string is contained in another string:The index () method and the Find () method determine the location of a substring: the difference between the index ()
After installing the NumPy module, I started to do a few small tests to run, but when I created numpy.py this filenumpy.pyimport numpyy = Numpy.array ([[[11,4,2],[2,6,1],[32,6,42]])print(y)After the operation error:Traceback (most recent):File "D:\Python_Reptile\numpy.py", line 1, Import NumPyFile "D:\Python_Reptile\numpy.py", line 2, y = Numpy.array ([[11,4,2],[2,6,1],[32,6,42]])Attributeerror:module ' NumPy ' has no attribute ' array 'Baidu opened the query for a long time, and the previous te
NumPy as the basis for the scientific calculation of Python, why Python is suitable for mathematical calculations, in addition to being easy to understand and easy to learn Python can simply invoke a large number of legacy libraries written in C and Fortran. The NumPy ndarray:a multidimensional Array Object Ndarray, which can be understood as an n-dimensional ar
U.S. scientists announced 11th that they first detected gravitational waves last September. This discovery confirms the prophecy of the physicist Einstein 100 years ago. Announcing the discovery was the head of the laser-interferometric gravitational Wave Observatory (LIGO).
The institution was born in the 90 's and has been observed for nearly 30 years by gravitational wave observations. So the amount of gravitational wave data that is observed shou
automatically added as index Here you can simply replace index, generate a new series, People think, for NumPy, not explicitly specify index, but also can be through the shape of the index to the data, where the index is essentially the same as the numpy of the Shaping indexSo for the numpy operation, the same applies to pandas At the same time, it said that series is actually a dictionary, so you can also use a
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.