Is there any difference between read_table and read_csv in pandas?

I tested it and also checked the documentation with no apparent differences. In any case, I wanted to ask just in case.

Do you think read_csv should be used only for csv, even if it works for other types? and read_table works for anything? and if they are the same, as long as they exist?

+4
source share
1 answer

You can work either for files with a common restriction, the difference is the default settings, for example sep, the tab for read_table, but ,for read_csv. They are both implemented equally under

If you look at the source

:

read_csv = _make_parser_function('read_csv', sep=',')
read_csv = Appender(_read_csv_doc)(read_csv)

read_table = _make_parser_function('read_table', sep='\t')
read_table = Appender(_read_table_doc)(read_table)

_make_parser_function:

def _make_parser_function(name, sep=','):

- , sep arg

+3

Source: https://habr.com/ru/post/1666936/


All Articles