Sign In Start Free Trial
Account

Add to playlist

Create a Playlist

Modal Close icon
You need to login to use this feature.
  • Book Overview & Buying Learning Pandas
  • Table Of Contents Toc
Learning Pandas

Learning Pandas

By : Michael Heydt
4.2 (10)
close
close
Learning Pandas

Learning Pandas

4.2 (10)
By: Michael Heydt

Overview of this book

If you are a Python programmer who wants to get started with performing data analysis using pandas and Python, this is the book for you. Some experience with statistical analysis would be helpful but is not mandatory.
Table of Contents (14 chapters)
close
close
13
Index

Selecting array elements

NumPy arrays can have their elements accessed via the [] operator. There are many variants of this operator that we will see throughout this book, but the basic access to array elements is by passing the zero-based offset of the desired element:

In [24]:
   # select 0-based elements 0 and 2
   a1[0], a1[2]

Out[24]:
   (0, 2)

Elements in a two-dimensional array can be used by making use of two values separated by a comma, with the row first and column second:

In [25]:
   # select an element in 2d array at row 1 column 2
   m[1, 2]

Out[25]:
   6

It is possible to retrieve an entire row of a two-dimensional array using just a single value representing the row and omitting the column component:

In [26]:
# all items in row 1
m[1,]

Out[26]:
array([4, 5, 6, 7])

It is possible to retrieve an entire column of a two-dimensional array using the : symbol for the row (just omitting the row value is a syntax error):

In [27]:
   # all items in column 2
   m[:,2]

Out[27]:
   array...
Visually different images
CONTINUE READING
83
Tech Concepts
36
Programming languages
73
Tech Tools
Icon Unlimited access to the largest independent learning library in tech of over 8,000 expert-authored tech books and videos.
Icon Innovative learning tools, including AI book assistants, code context explainers, and text-to-speech.
Icon 50+ new titles added per month and exclusive early access to books as they are being written.
Learning Pandas
notes
bookmark Notes and Bookmarks search Search in title playlist Add to playlist font-size Font size

Change the font size

margin-width Margin width

Change margin width

day-mode Day/Sepia/Night Modes

Change background colour

Close icon Search
Country selected

Close icon Your notes and bookmarks

Confirmation

Modal Close icon
claim successful

Buy this book with your credits?

Modal Close icon
Are you sure you want to buy this book with one of your credits?
Close
YES, BUY

Submit Your Feedback

Modal Close icon
Modal Close icon
Modal Close icon