@@ -998,7 +998,18 @@ def from_csv(cls, path, header=0, sep=',', index_col=0,
998
998
parse_dates = True , encoding = None , tupleize_cols = False ,
999
999
infer_datetime_format = False ):
1000
1000
"""
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.
1002
1013
1003
1014
Parameters
1004
1015
----------
@@ -1020,16 +1031,17 @@ def from_csv(cls, path, header=0, sep=',', index_col=0,
1020
1031
datetime format based on the first datetime string. If the format
1021
1032
can be inferred, there often will be a large parsing speed-up.
1022
1033
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
1028
1037
1029
1038
Returns
1030
1039
-------
1031
1040
y : DataFrame
1032
1041
"""
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 )
1033
1045
from pandas .io .parsers import read_table
1034
1046
return read_table (path , header = header , sep = sep ,
1035
1047
parse_dates = parse_dates , index_col = index_col ,
0 commit comments