Pandas series with custom index

0 votes
I am using pandas to create a series from a numpy array. The index is 0-n. I want the index to start from 100. How can I do this?
Apr 1, 2019 in Python by Simran
5,224 views

1 answer to this question.

0 votes

You can do it by specifying index. Like this:

import pandas as pd
import numpy as np
data = np.array(['a','b','c','d'])
s = pd.Series(data,index=[100,101,102,103])
print s
answered Apr 1, 2019 by Isha

Related Questions In Python

0 votes
1 answer

How does time series analysis with statsmodels work?

I'd really like to see a data ...READ MORE

answered Sep 4, 2018 in Python by Priyaj
• 58,020 points
4,549 views
–1 vote
1 answer
0 votes
1 answer
0 votes
1 answer

How to print pandas Dataframe without index?

You can print the dataframe without index ...READ MORE

answered Mar 28, 2019 in Python by Shri
6,988 views
0 votes
1 answer

How to create Pandas series from dictionary?

Here's a sample script: import pandas as pd import ...READ MORE

answered Apr 1, 2019 in Python by Prateek
2,337 views
0 votes
1 answer

How to create Pandas series from numpy array?

Hi. Refer to the below command: import pandas ...READ MORE

answered Apr 1, 2019 in Python by Pavan
3,520 views
0 votes
1 answer

How to convert pandas dataframe to numpy array?

Irrespective of whether the dataframe has similar ...READ MORE

answered May 13, 2019 in Python by Rishi
6,733 views
0 votes
1 answer
+2 votes
4 answers

How can I replace values with 'none' in a dataframe using pandas

Actually in later versions of pandas this ...READ MORE

answered Aug 13, 2018 in Python by bug_seeker
• 15,510 points
122,466 views
0 votes
1 answer

How to replace values with None in Pandas data frame in Python?

Actually in later versions of pandas this ...READ MORE

answered Aug 30, 2018 in Python by Priyaj
• 58,020 points
11,770 views
webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP