# -*- coding: utf-8 -*- """ Created on Mon Nov 28 10:58:54 2022 @author: cpresser """ import pandas as pd #df is a variable. It will hold a pandas data frame df = pd.read_csv("PlanetaryFactSheet.csv") #print an abbreviated version of the data frame print(df) print("--------------------------") #print the entire data frame #print(df.to_string()) print("--------------------------") #get the mass column of data print(df["Mass"]) print("--------------------------") #get the planet name and mass #put both names in a list [ ] print(df[ ["Planet", "Mass"] ]) print("--------------------------") #includes attributes for each column print(df.Planet) print("--------------------------") #data frame's loc access individual rows print(df.loc[0]) print("--------------------------") #data frame for rows 0 through 5 print(df.loc[2:5]) print("--------------------------") print(df[2:5]) print("--------------------------") #data frame's keys print(df.keys()) print("--------------------------") print(df[["Planet", "Ring System?"]]) print("--------------------------") #types of values in each column print(df.dtypes) print("--------------------------") #summary information for the data frame print(df.describe()) print("--------------------------") #summary information for the data frame print(df.describe().to_string())