Computer Science, asked by dhruba25, 5 days ago

What will be output of the following:

s = pd.Series([1,2,3,4,5])

print(s.size)

print(s.values)​

Answers

Answered by CoderRishav
1

Answer:

Sïze will be - 5

"s.values" is used to see the pandas DataFrame in numpy arrays , but "s.values" will give an error in your case because it will give the numpy of array of pandas DataFrame not pandas Series and in your cöde you are using for series instead of DataFrame . so if you want to covert pandas series to Numpy array use this "s.to_numpy()" for more try döcumentation!

Similar questions