Python | Pandas Series.set_value() Last Updated : 05 Feb, 2019 Summarize Comments Improve Suggest changes Share Like Article Like Report Pandas series is a One-dimensional ndarray with axis labels. The labels need not be unique but must be a hashable type. The object supports both integer- and label-based indexing and provides a host of methods for performing operations involving the index. Pandas Series.set_value() function is used to set value of the given series object using the index labels. Syntax: Series.set_value(label, value, takeable=False) Parameter : label : Partial indexing with MultiIndex not allowed value : Scalar value takeable : interpret the index as indexers, default False Returns : series Example #1: Use Series.set_value() function to set the value in the given series object using the index labels. Python3 # importing pandas as pd import pandas as pd # Creating the Series sr = pd.Series(['New York', 'Chicago', 'Toronto', 'Lisbon', 'Rio', 'Moscow']) # Create the Index index_ = ['City 1', 'City 2', 'City 3', 'City 4', 'City 5', 'City 6'] # set the index sr.index = index_ # Print the series print(sr) Output : Now we will use Series.set_value() function to set the value corresponding to the passed index label. Python3 1== # set the value sr.set_value('City 2', 'Dublin') Output : As we can see in the output, the Series.set_value() function has successfully set the value of the passed index label. Example #2: Use Series.set_value() function to set the value in the given series object using the index labels. Python3 # importing pandas as pd import pandas as pd # Creating the Series sr = pd.Series([100, 25, 32, 118, 24, 65]) # Print the series print(sr) Output : Now we will use Series.set_value() function to set the value in the given series object. Python3 1== # set the value to 1000 of # the passed index label sr.set_value(3, 1000) Output : As we can see in the output, the Series.set_value() function has successfully set the value of the passed index label. Comment More infoAdvertise with us Next Article Python | Pandas Series.set_value() S Shubham__Ranjan Follow Improve Article Tags : Python Pandas Python-pandas Python pandas-series-methods AI-ML-DS With Python +1 More Practice Tags : python Similar Reads Python | Pandas Series.values Python is a great language for doing data analysis, primarily because of the fantastic ecosystem of data-centric python packages. Pandas is one of those packages and makes importing and analyzing data much easier. Pandas series is a One-dimensional ndarray with axis labels. The labels need not be un 2 min read Python | Pandas Series.take() Pandas series is a One-dimensional ndarray with axis labels. The labels need not be unique but must be a hashable type. The object supports both integer- and label-based indexing and provides a host of methods for performing operations involving the index. Pandas Series.take() function return the el 3 min read Python | Pandas Series.valid() Python is a great language for doing data analysis, primarily because of the fantastic ecosystem of data-centric python packages. Pandas is one of those packages and makes importing and analyzing data much easier. Pandas series is a One-dimensional ndarray with axis labels. The labels need not be un 2 min read Python | Pandas Series.get_values() Pandas series is a One-dimensional ndarray with axis labels. The labels need not be unique but must be a hashable type. The object supports both integer- and label-based indexing and provides a host of methods for performing operations involving the index. Pandas Series.get_values() function return 2 min read Python | Pandas Series.sub() Python is a great language for doing data analysis, primarily because of the fantastic ecosystem of data-centric Python packages. Pandas is one of those packages and makes importing and analyzing data much easier. Python Series.sub() is used to subtract series or list like objects with same length f 2 min read Like