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

  • axes: Returns the list of row axis tags.
  • **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

import pandas as pd
	import numpy as np

	s = pd.Series(np.random.randn(4))
	print(s)

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


**Example 2 (axes)**

Returns the list of row axis tags.

import pandas as pd
import numpy as np

s = pd.Series(np.random.randn(4))
print(s.axes)
[RangeIndex(start=0, stop=4, step=1)]
```

#python-pandas #data-science-training #artificial-intelligence #python #programming #pandas

PYTHON Pandas Basic Functions
3.90 GEEK