<jupyter_start><jupyter_text>Words of Caution - Remember to run the cell above. It's for setting up the environment so you can have access to what's needed for this lecture. For now, don't worry about what it means: we'll learn more about what's inside of it in the next few lectures.- Data science is not just about code, so please don't go over this notebook by itself. Have the relevant textbook sections or lecture video at hand so that you can go over the discussion along with the code. Thank you!   Python<jupyter_code>2 + 9
2 * 9
2 / 9
2 + 3 * 9
(2 + 3) * 9
# two to the power of four: 2 * 2 * 2 * 2
2 ** 4
'hello'<jupyter_output><empty_output><jupyter_text>Names<jupyter_code>a = 4
a
b = 9
b
a * 3
total = a + b
total
a = 10
total
total = a + b
total
'total'<jupyter_output><empty_output><jupyter_text>Why Names?<jupyter_code>hours_per_week = 40
weeks_per_year = 52
hours_per_year = hours_per_week * weeks_per_year
hours_per_year
# Minimum wage for businesses w/26 or more employees
# Goes up by $1/hr until 2022
ca_hourly_minimum_wage = 13.00
weekly_wages = hours_per_week * ca_hourly_minimum_wage
weekly_wages
yearly_wages = hours_per_year * ca_hourly_minimum_wage
yearly_wages
40 * 13.00
40 * 52 * 13.00<jupyter_output><empty_output><jupyter_text>Functions and Call Expressions<jupyter_code>abs(-5)
abs(1 - 3)
day_temp = 52
night_temp = 47
abs(night_temp - day_temp)
min(14, 15)
round(123.456)
round(123.456, 1)
round(123.456, ndigits=1)<jupyter_output><empty_output><jupyter_text>Tables<jupyter_code>cones = Table.read_table('cones.csv')
cones
cones.show(3)
cones.show()
cones.select('Flavor')
cones.select('Flavor', 'Price')
cones.select(Flavor, 'Price')
cones.drop('Price')
cones
cones_without_price = cones.drop('Price')
cones_without_price
cones.where('Flavor', 'chocolate')
cones.sort('Price')
cones.sort('Price', descending=True)
cones.sort('Flavor', descending=True)<jupyter_output><empty_output><jupyter_text>A more interesting table<jupyter_code>skyscrapers = Table.read_table('skyscrapers.csv')
skyscrapers
skyscrapers.where('city', 'Los Angeles')
skyscrapers.where('name', 'Empire State Building')
skyscrapers.where('city', 'New York City').sort('completed')
skyscrapers.where('city', 'New York City').sort('completed', descending=True)<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.11484716157205241, 'fraction_numerical': 0.03668122270742358, 'mean_word_length': 6.342948717948718, 'pattern_counts': {'":': 0, '<': 25, '<?xml version=': 0, '>': 25, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '6', 'dir': 'jupyter-structured-clean-dedup', 'id': '284734', 'license': 'CC0-1.0', 'n_tokens_mistral': 919, 'n_tokens_neox': 839, 'n_words': 228, 'path': 'lec/lec03/lec03.ipynb', 'repo_name': 'schoend/tu-fa21', 'size': '2290'}