September 2019
Intermediate to advanced
420 pages
10h 29m
English
Now, it's time to introduce another essential data science tool that comes preinstalled with Python Anaconda: pandas. pandas is built on NumPy and provides several useful tools and methods to deal with data structures in Python. Just as we generally import NumPy under the alias, np, it is common to import pandas under the pd alias:
In [6]: import pandas as pd
pandas provide a useful data structure called a DataFrame, which can be understood as a generalization of a 2D NumPy array, as shown here:
In [7]: pd.DataFrame({... 'model': [... 'Normal Bayes',... 'Multinomial Bayes',... 'Bernoulli Bayes'... ],... 'class': [... 'cv2.ml.NormalBayesClassifier_create()',... 'sklearn.naive_bayes.MultinomialNB()',... 'sklearn.naive_bayes.BernoulliNB()' ...Read now
Unlock full access