Вы находитесь на странице: 1из 6
Pandas Pandas is a open source python library. Built on top of Numpy with its high performance array-computing features. 1 Pandas offers rich data structure and functions to make working with structured data fas, easy, and expressive. 1 Main Features: 1D Support CSV, Excel, JSON, SQL, SAS, clipboard, HDFS and many more formats. Data cleansingleleaning Re-shape and merge data 1D Data Visualisation Series({], dtype: floatéa) 12 203 dtype: intes b 2 <3 type: intsa Series Series Series is a one-dimensional labeled array capable of holding data, ‘of any ype (integer, string, oat, python objec, etc). The axis labels are collectively called index 2 Syntax: BA andas.Series(data, index, dtype, copy) Gtype: Antes data : array-ko, dct, or scalar value Index :array-ke o Index (te), Values must be hashable and have the same length as data. Non-unique index values are allowed. Wil default to Rangelndiex (0, 1, 2-24) if not provided. I both a 2 Le ict and index sequence are used, tne index willoverrce the keys |] 2 1-e found in the sit, 4 Naw b 28 type : data type copy(beolean) : copy data, default False type: Floates Indexing and Slicing Operations on Series a1 type: intés 23 DP © 3 a4 2 False dtype: ints False me 2 dtype: bool fr a1 24 b 2 boos dtype: intsa «2 a 6 type: intoa Indexing and Slicing DataFrame Peete = b 2 a4 a itype: intea a aE dtype: intea CA Data frame is @ two-dimensional data structure, ie. data is aligned in a tabular fashion in rows and columns. © Features: 1 Heterogeneous tabular data structure 1 Size ~ Mutable 1 Labeled axes (rows and columns) 1 Can Perform Arithmetic operations on rows and columns DataFrame 1D The most common way to create a DataFrame is by using the letionary of equal-longth list. Frese rary) i coma f Sweety Eoerrarcry 4 70080245 M3017 2 20100640 GOOG 902 DataFrame| DataFrame ene ee] Data Accessing Data can be accessed in two ways ie using row and column index Cee 1s 15.0 Tem 17.3 Goos 30.2 Name: Price, dtype: Floatsa iY] 15-02-2008, Fa 7.3 shyan Nave: TBM, dtype: object Delete Column’ [D1Golumn can be deleted using de! ar drop commands ory H File Reading rere) Hae erp et Null Value Property_data 1 Let property_data.csv is a comma separated file having following data isnullp returns Dataframe of boolean values which are True for NaN values and Falge for not NaN values Null Value 1D sAsnull.any(axis) returns a boolean Series correspond'to row umber i axie for boolean series correspond to columns axis = Null Value C -fllina) is used to fil NaN values in Datatrame. os 2 1017.0 4 True em | 5 1800.8 5 False memceeonours True 6 850.0 Null Value Data Filtering 1 lina is used to fll NaN values in Datatrame. 7 3.0 ae ae 20 ae lane: NUM_BEDROOMS, type: Aloatet Data can be fitered by providing some boolean expression in DataFrame. Plotting 1D Pandas supports the matplotib library and ean be used to plat the data as well

Вам также может понравиться