Q:

Write a Pandas program to add some data to an existing Series

0

Write a Pandas program to add some data to an existing Series.

All Answers

need an explanation for this answer? contact us directly to get an explanation for this answer

import pandas as pd
s = pd.Series(['100', '200', 'python', '300.12', '400'])
print("Original Data Series:")
print(s)
print("\nData Series after adding some data:")
new_s = s.append(pd.Series(['500', 'php']))
print(new_s)

Sample Output:

Original Data Series:
0       100
1       200
2    python
3    300.12
4       400
dtype: object

Data Series after adding some data:
0       100
1       200
2    python
3    300.12
4       400
0       500
1       php
dtype: object       

need an explanation for this answer? contact us directly to get an explanation for this answer

total answers (1)

Similar questions


need a help?


find thousands of online teachers now