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
1,539 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
• 57,700 points
2,440 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
4,696 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
525 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
1,255 views
0 votes
1 answer

How to convert pandas dataframe to numpy array?

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

answered May 12, 2019 in Python by Rishi
5,578 views
0 votes
1 answer
+2 votes
2 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
27,210 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
• 57,700 points
7,043 views