English subtitles

← Dataframes - Intro to Data Science

Get Embed Code
2 Languages

Showing Revision 5 created 05/25/2016 by Udacity Robot.

  1. First of all, data in Pandas is often contained
  2. in a structure called a dataframe. A dataframe is
  3. a two-dimensional labeled data structure with columns which can
  4. be different types if necessary. For example types like string,
  5. int, float, and Boolean. You can think of a
  6. dataframe as being similar to an Excel spreadsheet. We'll
  7. talk about making dataframes in a bit. For now,
  8. here's what an example dataframe might look like. Using data
  9. describing passengers on the Titanic, and whether or not
  10. they survived the Titanic's tragic collision with an iceberg.
  11. Note that there are numerous columns. Name, age, fare,
  12. and survived? These columns have different data-types. There are also
  13. some Not-a-Number entries which happen when we don't specify
  14. a value. There are a bunch of cool things
  15. we can do with this data frame. Let's jump
  16. to the command line. Say that I had already loaded
  17. this data into a data frame called DF. We can operate on specific
  18. columns by calling on them as if they were keys in a dictionary. For
  19. example, DFH and we can call on specific rows by calling a data frame objects
  20. loc method, and passing the row index as an argument, for example, df.loc('a').