Series ‘shape’ attribute return the shape of the Series (number of rows, number of columns).
get_shape.py
import pandas as pd
primes = [2, 3, 5]
primes_index = ['first_prime', 'second_prime', 'third_prime']
primes_series = pd.Series(primes, index=primes_index, name='Hold the Prime numbers')
print('primes_series shape : ', primes_series.shape)
Output
primes_series shape : (3,)
No comments:
Post a Comment