Python Bytes: Print DataFrame Index | Data Science

Learn how to print the index of a Pandas DataFrame using Python with an example from the wine dataset. 🍷 #Python #DataScience

Python Bytes: Print DataFrame Index | Data Science
AC
2.0K views β€’ May 3, 2023
Python Bytes: Print DataFrame Index | Data Science

About this video

#Coded by Andrew C

import pandas as pd
from sklearn import datasets

wine_dataset = datasets.load_wine()

wine = pd.DataFrame(wine_dataset.data, columns=wine_dataset.feature_names)

for idx in wine.index:
print(idx, end = '. ')

Video Information

Views

2.0K

Likes

21

Duration

0:05

Published

May 3, 2023

User Reviews

4.3
(1)
Rate:

Related Trending Topics

LIVE TRENDS

Related trending topics. Click any trend to explore more videos.