@@ -387,11 +387,6 @@ The simplest case is to just pass in ``parse_dates=True``:
387387 # These are python datetime objects
388388 df.index
389389
390- .. ipython :: python
391- :suppress:
392-
393- os.remove(' foo.csv' )
394-
395390 It is often the case that we may want to store date and time data separately,
396391or store various date fields separately. the ``parse_dates `` keyword can be
397392used to specify a combination of columns to parse the dates and/or times from.
@@ -503,36 +498,40 @@ a single date rather than the entire array.
503498
504499Inferring Datetime Format
505500~~~~~~~~~~~~~~~~~~~~~~~~~
506- If you have `parse_dates ` enabled for some or all of your columns, and your
501+ If you have `` parse_dates ` ` enabled for some or all of your columns, and your
507502datetime strings are all formatted the same way, you may get a large speed
508- up by setting `infer_datetime_format=True `. If set, pandas will attempt
503+ up by setting `` infer_datetime_format=True ` `. If set, pandas will attempt
509504to guess the format of your datetime strings, and then use a faster means
510505of parsing the strings. 5-10x parsing speeds have been observed. Pandas
511506will fallback to the usual parsing if either the format cannot be guessed
512507or the format that was guessed cannot properly parse the entire column
513- of strings. So in general, `infer_datetime_format ` should not have any
508+ of strings. So in general, `` infer_datetime_format ` ` should not have any
514509negative consequences if enabled.
515510
516511Here are some examples of datetime strings that can be guessed (All
517512representing December 30th, 2011 at 00:00:00)
518513
519- "20111230"
520- "2011/12/30"
521- "20111230 00:00:00"
522- "12/30/2011 00:00:00"
523- "30/Dec/2011 00:00:00"
524- "30/December/2011 00:00:00"
514+ - "20111230"
515+ - "2011/12/30"
516+ - "20111230 00:00:00"
517+ - "12/30/2011 00:00:00"
518+ - "30/Dec/2011 00:00:00"
519+ - "30/December/2011 00:00:00"
525520
526- `infer_datetime_format ` is sensitive to `dayfirst `. With ` dayfirst=True `, it
527- will guess "01/12/2011" to be December 1st. With ` dayfirst=False ` (default)
528- it will guess "01/12/2011" to be January 12th.
521+ `` infer_datetime_format `` is sensitive to `` dayfirst `` . With
522+ `` dayfirst=True ``, it will guess "01/12/2011" to be December 1st. With
523+ `` dayfirst=False `` (default) it will guess "01/12/2011" to be January 12th.
529524
530525.. ipython :: python
531526
532527 # Try to infer the format for the index column
533528 df = pd.read_csv(' foo.csv' , index_col = 0 , parse_dates = True ,
534529 infer_datetime_format = True )
535530
531+ .. ipython :: python
532+ :suppress:
533+
534+ os.remove(' foo.csv' )
536535
537536 International Date Formats
538537~~~~~~~~~~~~~~~~~~~~~~~~~~
0 commit comments