import pandas as pd
# Create the DataFrame
data = {
2018: [110, 130,
115, 118],
2019: [205, 165,
206, 198],
2020: [177, 175,
157, 183],
2021: [189, 190,
179, 169]
}
salespersons = ["Kapil", "Kamini",
"Shikhar", "Mohini"]
sales_df = pd.DataFrame(data, index=salespersons)
# Display row labels
print("Row Labels:")
print(sales_df.index)
# Display column labels
print("\nColumn Labels:")
print(sales_df.columns)
# Display data types of each column
print("\nData Types:")
print(sales_df.dtypes)
No comments:
Post a Comment