Python | Метод Pandas DataFrame.to_html ()

Опубликовано: 27 Марта, 2022

With help of DataFrame.to_html() method, we can get the html format of a dataframe by using DataFrame.to_html() method.

Syntax : DataFrame.to_html()
Return : Return the html format of a dataframe.

Example #1 :
In this example we can say that by using DataFrame.to_html() method, we are able to get the html format of a dataframe.

# import DataFrame
import pandas as pd
  
# using DataFrame.to_html() method
gfg = pd.DataFrame({"Name": ["Marks"], 
                    "Jitender": ["78"],
                    "Rahul": ["77.9"]})
  
print(gfg.to_html())

Выход :

NameJitenderRahul
0Marks7877.9

Пример №2:

Выход :

NameJitenderPurnima
0Marks7878.9
1GenderMaleFemale

Внимание компьютерщик! Укрепите свои основы с помощью базового курса программирования Python и изучите основы.

Для начала подготовьтесь к собеседованию. Расширьте свои концепции структур данных с помощью курса Python DS. А чтобы начать свое путешествие по машинному обучению, присоединяйтесь к курсу Машинное обучение - базовый уровень.