Python | pandas.to_markdown() in Pandas Read Courses Practice Improve Improve Improve Like Article Like Save Article Save Report issue Report With the help of pandas.to_markdown() method, we can get the markdown table from the given dataframes by using pandas.to_markdown() method. Syntax : pandas.to_markdown() Return : Return the markdown table. Example #1 : In this example we can see that by using pandas.to_markdown() method, we are able to get the markdown table from the given dataframes by using this method. # import pandas import pandas as pd df = pd.DataFrame({"A": [1, 2, 3], "B": [1.1, 2.2, 3.3]}, index =['a', 'a', 'b']) # Using pandas.to_markdown() method gfg = df.to_markdown() print(gfg) Output : | | A | B | |:---|----:|----:| | a | 1 | 1.1 | | a | 2 | 2.2 | | b | 3 | 3.3 | Example #2 : # import pandas import pandas as pd df = pd.DataFrame({"A": [3, 4, 5], "B": ['c', 'd', 'e']}, index =['I', 'II', 'III']) # Using pandas.to_markdown() method gfg = df.to_markdown() print(gfg) Output : | | A | B | |:----|----:|:----| | I | 3 | c | | II | 4 | d | | III | 5 | e | Don't miss your chance to ride the wave of the data revolution! Every industry is scaling new heights by tapping into the power of data. Sharpen your skills and become a part of the hottest trend in the 21st century. Dive into the future of technology - explore the Complete Machine Learning and Data Science Program by GeeksforGeeks and stay ahead of the curve. Last Updated : 22 Apr, 2020 Like Article Save Article Previous Python | Pandas dataframe.clip_lower() Next PyQt5 – Background image to indicator of checked radio button when mouse hover Share your thoughts in the comments Add Your Comment Please Login to comment...