Complete the code to create a pandas Series from a list.
import pandas as pd data = [10, 20, 30] series = pd.[1](data) print(series)
The Series function creates a 1D labeled array in pandas.
Complete the code to access the first element of a Series.
import pandas as pd s = pd.Series([5, 10, 15]) first_element = s.[1][0] print(first_element)
iloc is used to access elements by integer position in a Series.
Fix the error in the code to create a Series with custom index labels.
import pandas as pd values = [100, 200, 300] labels = ['a', 'b', 'c'] s = pd.Series([1], index=[2]) print(s)
The first argument is the data values, and the second is the index labels.
Fill both blanks to create a Series and filter values greater than 15.
import pandas as pd s = pd.Series([10, 20, 30, 5]) filtered = s[s [1] [2]] print(filtered)
Use the greater than operator and the number 15 to filter values.
Fill all three blanks to create a dictionary from a Series with values greater than 10 and keys as uppercase labels.
import pandas as pd s = pd.Series([5, 15, 25], index=['x', 'y', 'z']) result = [1]([2].upper(): [3] for [2], [3] in s.items() if [3] > 10) print(result)
Create a dictionary with keys as uppercase labels and values filtered by >10.
