Python | Pandas Series.to_csv() Last Updated : 24 Jun, 2020 Comments Improve Suggest changes 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.to_csv() function write the given series object to a comma-separated values (csv) file/format. Syntax: Series.to_csv(*args, **kwargs) Parameter : path_or_buf : File path or object, if None is provided the result is returned as a string. sep : String of length 1. Field delimiter for the output file. na_rep : Missing data representation. float_format : Format string for floating point numbers. columns : Columns to write header : If a list of strings is given it is assumed to be aliases for the column names. index : Write row names (index). index_label : Column label for index column(s) if desired. If None is given, and header and index are True, then the index names are used. mode : Python write mode, default ‘w’. encoding : A string representing the encoding to use in the output file. compression : Compression mode among the following possible values: {‘infer’, ‘gzip’, ‘bz2’, ‘zip’, ‘xz’, None}. quoting : Defaults to csv.QUOTE_MINIMAL. quotechar : String of length 1. Character used to quote fields. Returns : None or str Example #1: Use Series.to_csv() function to convert the given series object to csv format. Python3 # importing pandas as pd import pandas as pd # Creating the Series sr = pd.Series(['New York', 'Chicago', 'Toronto', 'Lisbon', 'Rio', 'Moscow']) # Create the Datetime Index didx = pd.DatetimeIndex(start ='2014-08-01 10:00', freq ='W', periods = 6, tz = 'Europe / Berlin') # set the index sr.index = didx # Print the series print(sr) Output : Now we will use Series.to_csv() function to convert the given Series object into a comma separated format. Python3 1== # convert to comma-separated sr.to_csv() Output : As we can see in the output, the Series.to_csv() function has converted the given Series object into a comma-separated format. Example #2: Use Series.to_csv() function to convert the given series object to csv format. Python3 # importing pandas as pd import pandas as pd # Creating the Series sr = pd.Series([19.5, 16.8, None, 22.78, None, 20.124, None, 18.1002, None]) # Print the series print(sr) Output : Now we will use Series.to_csv() function to convert the given Series object into a comma separated format. Python3 1== # convert to comma-separated sr.to_csv() Output : As we can see in the output, the Series.to_csv() function has converted the given Series object into a comma-separated format. Comment More infoAdvertise with us Next Article Python | Pandas Series.to_csv() 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.to_numeric method 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.to_numeric() is one of the general functions in Pandas which is used to convert 2 min read Pandas DataFrame.to_string-Python Pandas is a powerful Python library for data manipulation, with DataFrame as its key two-dimensional, labeled data structure. It allows easy formatting and readable display of data. DataFrame.to_string() function in Pandas is specifically designed to render a DataFrame into a console-friendly tabula 5 min read pandas.concat() function in Python The pandas.concat() function does all the heavy lifting of performing concatenation operations along with an axis of Pandas objects while performing optional set logic (union or intersection) of the indexes (if any) on the other axes. Pandas concat() function SyntaxSyntax: concat(objs, axis, join, i 4 min read Python | Pandas dataframe.cov() 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 dataframe.cov() is used to compute pairwise covariance of columns. If some of t 2 min read Pandas DataFrame duplicated() Method - Python Pandas is widely used library in Python used for tasks like cleaning, analyzing and transforming data. One important part of cleaning data is identifying and handling duplicate rows which can lead to incorrect results if left unchecked.The duplicated() method in Pandas helps us to find these duplica 2 min read Pandas dataframe.drop_duplicates() When working with data in Pandas one common task is removing duplicate rows to ensure clean and accurate datasets. The drop_duplicates() method in Pandas is designed to make this process quick and easy. It allows us to remove duplicate rows from a DataFrame based on all columns or specific ones. By 4 min read Pandas DataFrame.dropna() Method Pandas is one of the packages that makes importing and analyzing data much easier. Sometimes CSV file has null values, which are later displayed as NaN in Pandas DataFrame. Pandas dropna() method allows the user to analyze and drop Rows/Columns with Null values in different ways.  Pandas DataFrame. 3 min read Python | Pandas dataframe.diff() 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 dataframe.diff() is used to find the first discrete difference of objects over 2 min read Pandas Dataframe rank() | Rank DataFrame Entries Python is a great language for 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 DataFrame rank() method returns a rank of every respective entry (1 through n) along 3 min read Python | Pandas dataframe.mask() 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 dataframe.mask() function return an object of same shape as self and whose corr 3 min read Like