Page 228 - Ai Book - 10
P. 228

You should always remember that if you want to sort the values in descending order, then you should assign
            False value to the parameter ‘ascending’. For example,

                 df = pd.read_excel(r’F:\Book_list.xlsx’)
                 df = df.sort_values(by=’Price’,ascending = False)
                 print (df.head())
            This code sorts the list of items in descending order on the basis of price. Thus, you will get the following output:





















            Matplotlib
            Matplotlib is one of the most popular Python packages used for data visualization.
            It has a platform independent library for making 2D plots from data in arrays.
            Matplotlib  is  written in  Python  and  makes use of NumPy,  the numerical
            mathematics extension of Python.

            Using Matplotlib, we can draw various types of charts and graphs. The data visualisation in the form of charts
            and graphs helps us to make a thought of clarity about trends and patterns. In simple terms, we can say that data
            visualisation is a good technique for reasoning about quantitative information. Here, some types of graphs are
            given below that we can draw with this package:

             u   Pie Plot          u   Area Plot         u   Bar Graph         u   Scatter Plot     u   Histogram












            Using this package, we can easily customize all kinds of graphical properties, like controlling the width and
            colour of lines, annotating, or adding a legend etc. As you know, we have a lot of datasets at the time of data
            acquisition. The appropriate exploration of datasets is a necessary step before training an AI model.
            With the help of these packages, we can easily explore the meaningful data.

            STATISTICAL LEARNING WITH PYTHON

            The term “Data science” is an interdisciplinary field that uses scientific methods, processes, algorithms and
            systems  to extract knowledge  and  insights among the data. The field  of data science is  purely based on
            mathematics and statistics because we cannot train a model until appropriate analysis of data takes place.




                102
                102
   223   224   225   226   227   228   229   230   231   232   233