Python Pandas: Create series using list of values

0 votes

Hi. I have a list of values using which I want to create a Pandas Series. Please tell me how to do it. The list of values is as follows:

[1, 3, 5, 6, 8]
May 9 in Python by Ritu
11 views

1 answer to this question.

0 votes

You can do this using series method. Refer to the below code:

s = pd.Series([1, 3, 5, 6, 8])
print(s)
0    1.0
1    3.0
2    5.0
3    6.0
4    8.0
dtype: float64
answered May 9 by Yogi

Related Questions In Python

0 votes
1 answer

How to create Pandas dataframe from Python list?

You can do it like this: import ...READ MORE

answered Apr 5 in Python by Likhita
37 views
0 votes
1 answer

How do I create 3 X 4 array of random numbers between 0 and 100 using python?

Use numpy in the following manner: np.random.rand(3,4)*100 When you ...READ MORE

answered May 24 in Python by Radhika
15 views
0 votes
1 answer

How do I create a star using the turtle module of python?

Hey @Jinu, Try something like this: import turtle star = ...READ MORE

answered Jun 21 in Python by Neha
31 views
0 votes
1 answer
0 votes
1 answer
+1 vote
2 answers

how can i count the items in a list?

Syntax :            list. count(value) Code: colors = ['red', 'green', ...READ MORE

answered Jul 6 in Python by Neha
• 330 points

edited Jul 8 by Kalgi 134 views
0 votes
1 answer

What is the recommended way to randomize a list of strings using Python?

Hi. Nice question. Here is the simplified answer ...READ MORE

answered Jan 18 in Python by Nymeria
• 3,500 points
38 views
+1 vote
4 answers

Count the frequency of an item in a python list

To count the number of appearances: from collections ...READ MORE

answered Oct 18, 2018 in Python by tinitales
172 views