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, 2019 in Python by Ritu
80 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, 2019 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, 2019 in Python by Likhita
386 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, 2019 in Python by Radhika
81 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, 2019 in Python by Neha
240 views
0 votes
1 answer
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
294 views
+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, 2019 in Python by Neha
• 330 points

edited Jul 8, 2019 by Kalgi 1,354 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, 2019 in Python by Nymeria
• 3,520 points
134 views
+1 vote
7 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
10,683 views