# -*- coding: utf-8 -*- """ Created on Fri Dec 9 11:03:26 2022 @author: cpresser """ x = 4.56 x = float("4.56") print(x) x = eval("2+3*4") print(x) x = eval("'hi' + ' there'") print(x) y = 5.6 z = "hello" print(z+str(y)) eval("3.4") import pandas as pd df = pd.read_csv("../data/periodic_table.csv") print(df.iloc[0,0]) # 1 print(df.iloc[0,1]) # Hydrogen #access columns print(df.Element) print(df["Element"]) #access a row print(df.loc[0]) #locate rows print(df.loc[df.Year >= 1900]) #find max print(df.BoilingPoint.max()) print(max(df.BoilingPoint)) #find the name of the max index = df.BoilingPoint.idxmax() print(df.Element[index]) diff = df.BoilingPoint - df.MeltingPoint print(diff) #numpy import numpy as np arr1 = np.array([2,3,4,5]) arr2 = np.array([7,8,9,0]) print(arr1+arr2) print(np.sum(arr1)) print(np.max(arr2)) print(np.sin(arr1)) user = input("Enter a number: ") try: value = float(user) print("Success") except: print("An error occurred.") value = 0 print(value)