July 2017
Intermediate to advanced
382 pages
9h 13m
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 a number of 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 provides a useful data structure called 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()', ...Read now
Unlock full access