array thats passed into a pandas series for creating a series from a dict can

Array thats passed into a pandas series for creating

This preview shows page 2 - 3 out of 3 pages.

array that's passed into a pandas series # for creating a series from a dict, can slice to a specific value like salary_data['Data Scientist']
Image of page 2
# can slice to a range like salary_data['Data Scientist': 'Software Engineer'] # salary_data.index is an object of it's keys # can't change the index, it's immutable # keys of a dictionary are an instance of a class, can use a __lt__ that makes the instances of that class orderable # dataframes are like series but with multiple columns # can have two dictionaries if they have the same indicies, then can create a dataframe from that # if you have a dataframe and index jobs['openings'], then type(jobs['openings']) is a series # jobs['openings']['Software Engineering'] and that will give the openings # jobs['salary']['Software Engineering'] and that will give the salary # jobs.loc['Data Scientist'] indexes by row # jobs.iloc[:2] is the same as jobs[:2] # jobs[jobs['salary'] >= 100000] # jobs['CS 2316 prepares'] = True broadcasts all values to the series
Image of page 3

You've reached the end of your free preview.

Want to read all 3 pages?

  • Spring '12
  • summet

  • Left Quote Icon

    Student Picture

  • Left Quote Icon

    Student Picture

  • Left Quote Icon

    Student Picture