Skip to content

learndataa

Imagine data to solve problems

  • Home
  • YouTube Courses
  • Udemy Courses
  • Training
  • About
  • Privacy Policy
  • Facebook
  • Twitter
  • Instagram
  • Pinterest
  • Home
  • YouTube Courses
  • Udemy Courses
  • Training
  • About
  • Privacy Policy
  • Facebook
  • Twitter
  • Instagram
  • Pinterest

Pandas: Create a Series using a dictionary

30 July 2020

Code

# Import library
import pandas as pd

# Create a dictionary
x_dict = {'a': 1, 'b': 2, 'c': [1,2]}

# Create a Series
x = pd.Series(x_dict)

# Output
print(x)
print(type(x))

Output

a         1
b         2
c    [1, 2]
dtype: object
<class 'pandas.core.series.Series'>






Any errors in code above?
Please send a message.

Share this:

  • Click to share on X (Opens in new window) X
  • Click to share on Facebook (Opens in new window) Facebook
  • Home
  • YouTube Courses
  • Udemy Courses
  • Training
  • About
  • Privacy Policy
  • Facebook
  • Twitter
  • Instagram
  • Pinterest
learndataa, Website Powered by WordPress.com.
  • Subscribe Subscribed
    • learndataa
    • Already have a WordPress.com account? Log in now.
    • learndataa
    • Subscribe Subscribed
    • Sign up
    • Log in
    • Copy shortlink
    • Report this content
    • View post in Reader
    • Manage subscriptions
    • Collapse this bar