@@ -998,7 +998,18 @@ def from_csv(cls, path, header=0, sep=',', index_col=0,
998998 parse_dates = True , encoding = None , tupleize_cols = False ,
999999 infer_datetime_format = False ):
10001000 """
1001- Read delimited file into DataFrame
1001+ DEPRECATED. Please use :func:`pandas.read_csv` instead.
1002+
1003+ The preferred :func:`pandas.read_csv` only differs from this method
1004+ in some defaults:
1005+
1006+ - `index_col` is ``None`` instead of ``0`` (first column)
1007+ - `parse_dates` is ``False`` instead of ``True`` (parsing the index)
1008+
1009+ So a ``pd.DataFrame.from_csv(path)`` can be replaced by
1010+ ``pd.read_csv(path, index_col=0, parse_dates=True)``.
1011+
1012+ Read delimited file into DataFrame.
10021013
10031014 Parameters
10041015 ----------
@@ -1020,16 +1031,17 @@ def from_csv(cls, path, header=0, sep=',', index_col=0,
10201031 datetime format based on the first datetime string. If the format
10211032 can be inferred, there often will be a large parsing speed-up.
10221033
1023- Notes
1024- -----
1025- Preferable to use read_table for most general purposes but from_csv
1026- makes for an easy roundtrip to and from file, especially with a
1027- DataFrame of time series data
1034+ See also
1035+ --------
1036+ pandas.read_csv
10281037
10291038 Returns
10301039 -------
10311040 y : DataFrame
10321041 """
1042+ warnings .warn ("'DataFrame.from_csv' is deprecated. Use 'pandas.read_csv'"
1043+ " instead (only the defaults for the 'index_col'"
1044+ " and 'parse_dates' arguments differ)." , FutureWarning )
10331045 from pandas .io .parsers import read_table
10341046 return read_table (path , header = header , sep = sep ,
10351047 parse_dates = parse_dates , index_col = index_col ,
0 commit comments