PYTHON Pandas Basic Functions

Furkan Gulsen
Jul 4, 2020 · 2 min read

So far, we have learned the three pandas data structure and how to create them. Due to its importance in real-time data processing, we will focus on dataframe objects right now and mention a few other data structures.

Basic Functions of Series

  • dtype: Returns the dtype object.
  • empty: Returns false in serial empty job.
  • ndim: Returns the number of dimensions of the underlying data as definition 1.
  • size: Returns the number of basic data items.
  • values: Returns the series as ndarray.
  • head: Returns the first n lines.
  • tail: Returns the last n lines.

Let’s consolidate the above structures with examples.

Example 1

0    1.373370
1 -0.960120
2 0.143523
3 0.553266
dtype: float64

Example 2 (axes)
Returns the list of row axis tags.

[RangeIndex(start=0, stop=4, step=1)]

Example 3 (empty)
Returns the dtype object.

False

Example 4 (ndim)
Returns the number of dimensions of the underlying data as definition 1.

1

Example 5 (size)
Returns the number of basic data items.

4

Example 6 (values)
Returns the series as ndarray.

[0.22313449 0.40836713 1.72190058 0.84874151]

Example 7 (head)
Returns the first n lines.

0    0.405320
1 2.096544
dtype: float64

Example 8 (tail)
Returns the last n lines.

2    1.790909
3 -1.439368
dtype: float64

Analytics Vidhya

Analytics Vidhya is a community of Analytics and Data…

Medium is an open platform where 170 million readers come to find insightful and dynamic thinking. Here, expert and undiscovered voices alike dive into the heart of any topic and bring new ideas to the surface. Learn more

Follow the writers, publications, and topics that matter to you, and you’ll see them on your homepage and in your inbox. Explore

If you have a story to tell, knowledge to share, or a perspective to offer — welcome home. It’s easy and free to post your thinking on any topic. Write on Medium

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store