# ---
# jupyter:
#   jupytext:
#     text_representation:
#       extension: .py
#       format_name: light
#       format_version: '1.5'
#       jupytext_version: 1.14.4
#   kernelspec:
#     display_name: Python 3
#     language: python
#     name: python3
# ---

import numpy as np
import pandas as pd

labels = ['a','b','c']
my_list = [10,20,30]
arr = np.array([10,20,30])
d = {'a':10,'b':20,'c':30}

labels

my_list

arr

d

# + active=""
# Using Lists
# -

pd.Series(my_list)

pd.Series(my_list,labels)

# + active=""
# Using Numpy Arrays
# -

pd.Series(arr)

pd.Series(arr,labels)

# + active=""
# Using Dictionary
# -

pd.Series(d)

# + active=""
# Data in Series
# -

pd.Series(labels)

pd.Series([sum,print,len])

# + active=""
# Using an Index
# -

ser1 = pd.Series(['USA','IND','CHIN','PEEP'],[1,2,3,4])

ser1

ser1 = pd.Series([1,2,3,4],['USA','IND','CHIN','PEEP'])

ser1

ser1 = pd.Series(data = [1,2,3,4],index = ['USA','IND','CHIN','PEEP'])

ser1

ser2 = pd.Series([1,3,2,4],['USA','PID','LPU','PEEP'])

ser2

ser = ser1 + ser2
ser

ser1['USA']

ser['USA']

ser2['PEEP']



StarcoderdataJupyterScriptsDedupFiltered