12 KiB
12 KiB
import pandas as pd
df = pd.read_csv(r'C:\Users\HP\Desktop\podyplomówka\gapminder.csv')
print(df)
[1;31m---------------------------------------------------------------------------[0m [1;31mFileNotFoundError[0m Traceback (most recent call last) Cell [1;32mIn[20], line 1[0m [1;32m----> 1[0m df [38;5;241m=[39m [43mpd[49m[38;5;241;43m.[39;49m[43mread_csv[49m[43m([49m[38;5;124;43mr[39;49m[38;5;124;43m'[39;49m[38;5;124;43mC:[39;49m[38;5;124;43m\[39;49m[38;5;124;43mUsers[39;49m[38;5;124;43m\[39;49m[38;5;124;43mHP[39;49m[38;5;124;43m\[39;49m[38;5;124;43mDesktop[39;49m[38;5;124;43m\[39;49m[38;5;124;43mpodyplomówka[39;49m[38;5;124;43m\[39;49m[38;5;124;43mgapminder.csv[39;49m[38;5;124;43m'[39;49m[43m)[49m [0;32m 4[0m [38;5;28mprint[39m(df) File [1;32m~\anaconda3\lib\site-packages\pandas\io\parsers\readers.py:948[0m, in [0;36mread_csv[1;34m(filepath_or_buffer, sep, delimiter, header, names, index_col, usecols, dtype, engine, converters, true_values, false_values, skipinitialspace, skiprows, skipfooter, nrows, na_values, keep_default_na, na_filter, verbose, skip_blank_lines, parse_dates, infer_datetime_format, keep_date_col, date_parser, date_format, dayfirst, cache_dates, iterator, chunksize, compression, thousands, decimal, lineterminator, quotechar, quoting, doublequote, escapechar, comment, encoding, encoding_errors, dialect, on_bad_lines, delim_whitespace, low_memory, memory_map, float_precision, storage_options, dtype_backend)[0m [0;32m 935[0m kwds_defaults [38;5;241m=[39m _refine_defaults_read( [0;32m 936[0m dialect, [0;32m 937[0m delimiter, [1;32m (...)[0m [0;32m 944[0m dtype_backend[38;5;241m=[39mdtype_backend, [0;32m 945[0m ) [0;32m 946[0m kwds[38;5;241m.[39mupdate(kwds_defaults) [1;32m--> 948[0m [38;5;28;01mreturn[39;00m [43m_read[49m[43m([49m[43mfilepath_or_buffer[49m[43m,[49m[43m [49m[43mkwds[49m[43m)[49m File [1;32m~\anaconda3\lib\site-packages\pandas\io\parsers\readers.py:611[0m, in [0;36m_read[1;34m(filepath_or_buffer, kwds)[0m [0;32m 608[0m _validate_names(kwds[38;5;241m.[39mget([38;5;124m"[39m[38;5;124mnames[39m[38;5;124m"[39m, [38;5;28;01mNone[39;00m)) [0;32m 610[0m [38;5;66;03m# Create the parser.[39;00m [1;32m--> 611[0m parser [38;5;241m=[39m TextFileReader(filepath_or_buffer, [38;5;241m*[39m[38;5;241m*[39mkwds) [0;32m 613[0m [38;5;28;01mif[39;00m chunksize [38;5;129;01mor[39;00m iterator: [0;32m 614[0m [38;5;28;01mreturn[39;00m parser File [1;32m~\anaconda3\lib\site-packages\pandas\io\parsers\readers.py:1448[0m, in [0;36mTextFileReader.__init__[1;34m(self, f, engine, **kwds)[0m [0;32m 1445[0m [38;5;28mself[39m[38;5;241m.[39moptions[[38;5;124m"[39m[38;5;124mhas_index_names[39m[38;5;124m"[39m] [38;5;241m=[39m kwds[[38;5;124m"[39m[38;5;124mhas_index_names[39m[38;5;124m"[39m] [0;32m 1447[0m [38;5;28mself[39m[38;5;241m.[39mhandles: IOHandles [38;5;241m|[39m [38;5;28;01mNone[39;00m [38;5;241m=[39m [38;5;28;01mNone[39;00m [1;32m-> 1448[0m [38;5;28mself[39m[38;5;241m.[39m_engine [38;5;241m=[39m [38;5;28;43mself[39;49m[38;5;241;43m.[39;49m[43m_make_engine[49m[43m([49m[43mf[49m[43m,[49m[43m [49m[38;5;28;43mself[39;49m[38;5;241;43m.[39;49m[43mengine[49m[43m)[49m File [1;32m~\anaconda3\lib\site-packages\pandas\io\parsers\readers.py:1705[0m, in [0;36mTextFileReader._make_engine[1;34m(self, f, engine)[0m [0;32m 1703[0m [38;5;28;01mif[39;00m [38;5;124m"[39m[38;5;124mb[39m[38;5;124m"[39m [38;5;129;01mnot[39;00m [38;5;129;01min[39;00m mode: [0;32m 1704[0m mode [38;5;241m+[39m[38;5;241m=[39m [38;5;124m"[39m[38;5;124mb[39m[38;5;124m"[39m [1;32m-> 1705[0m [38;5;28mself[39m[38;5;241m.[39mhandles [38;5;241m=[39m [43mget_handle[49m[43m([49m [0;32m 1706[0m [43m [49m[43mf[49m[43m,[49m [0;32m 1707[0m [43m [49m[43mmode[49m[43m,[49m [0;32m 1708[0m [43m [49m[43mencoding[49m[38;5;241;43m=[39;49m[38;5;28;43mself[39;49m[38;5;241;43m.[39;49m[43moptions[49m[38;5;241;43m.[39;49m[43mget[49m[43m([49m[38;5;124;43m"[39;49m[38;5;124;43mencoding[39;49m[38;5;124;43m"[39;49m[43m,[49m[43m [49m[38;5;28;43;01mNone[39;49;00m[43m)[49m[43m,[49m [0;32m 1709[0m [43m [49m[43mcompression[49m[38;5;241;43m=[39;49m[38;5;28;43mself[39;49m[38;5;241;43m.[39;49m[43moptions[49m[38;5;241;43m.[39;49m[43mget[49m[43m([49m[38;5;124;43m"[39;49m[38;5;124;43mcompression[39;49m[38;5;124;43m"[39;49m[43m,[49m[43m [49m[38;5;28;43;01mNone[39;49;00m[43m)[49m[43m,[49m [0;32m 1710[0m [43m [49m[43mmemory_map[49m[38;5;241;43m=[39;49m[38;5;28;43mself[39;49m[38;5;241;43m.[39;49m[43moptions[49m[38;5;241;43m.[39;49m[43mget[49m[43m([49m[38;5;124;43m"[39;49m[38;5;124;43mmemory_map[39;49m[38;5;124;43m"[39;49m[43m,[49m[43m [49m[38;5;28;43;01mFalse[39;49;00m[43m)[49m[43m,[49m [0;32m 1711[0m [43m [49m[43mis_text[49m[38;5;241;43m=[39;49m[43mis_text[49m[43m,[49m [0;32m 1712[0m [43m [49m[43merrors[49m[38;5;241;43m=[39;49m[38;5;28;43mself[39;49m[38;5;241;43m.[39;49m[43moptions[49m[38;5;241;43m.[39;49m[43mget[49m[43m([49m[38;5;124;43m"[39;49m[38;5;124;43mencoding_errors[39;49m[38;5;124;43m"[39;49m[43m,[49m[43m [49m[38;5;124;43m"[39;49m[38;5;124;43mstrict[39;49m[38;5;124;43m"[39;49m[43m)[49m[43m,[49m [0;32m 1713[0m [43m [49m[43mstorage_options[49m[38;5;241;43m=[39;49m[38;5;28;43mself[39;49m[38;5;241;43m.[39;49m[43moptions[49m[38;5;241;43m.[39;49m[43mget[49m[43m([49m[38;5;124;43m"[39;49m[38;5;124;43mstorage_options[39;49m[38;5;124;43m"[39;49m[43m,[49m[43m [49m[38;5;28;43;01mNone[39;49;00m[43m)[49m[43m,[49m [0;32m 1714[0m [43m[49m[43m)[49m [0;32m 1715[0m [38;5;28;01massert[39;00m [38;5;28mself[39m[38;5;241m.[39mhandles [38;5;129;01mis[39;00m [38;5;129;01mnot[39;00m [38;5;28;01mNone[39;00m [0;32m 1716[0m f [38;5;241m=[39m [38;5;28mself[39m[38;5;241m.[39mhandles[38;5;241m.[39mhandle File [1;32m~\anaconda3\lib\site-packages\pandas\io\common.py:863[0m, in [0;36mget_handle[1;34m(path_or_buf, mode, encoding, compression, memory_map, is_text, errors, storage_options)[0m [0;32m 858[0m [38;5;28;01melif[39;00m [38;5;28misinstance[39m(handle, [38;5;28mstr[39m): [0;32m 859[0m [38;5;66;03m# Check whether the filename is to be opened in binary mode.[39;00m [0;32m 860[0m [38;5;66;03m# Binary mode does not support 'encoding' and 'newline'.[39;00m [0;32m 861[0m [38;5;28;01mif[39;00m ioargs[38;5;241m.[39mencoding [38;5;129;01mand[39;00m [38;5;124m"[39m[38;5;124mb[39m[38;5;124m"[39m [38;5;129;01mnot[39;00m [38;5;129;01min[39;00m ioargs[38;5;241m.[39mmode: [0;32m 862[0m [38;5;66;03m# Encoding[39;00m [1;32m--> 863[0m handle [38;5;241m=[39m [38;5;28;43mopen[39;49m[43m([49m [0;32m 864[0m [43m [49m[43mhandle[49m[43m,[49m [0;32m 865[0m [43m [49m[43mioargs[49m[38;5;241;43m.[39;49m[43mmode[49m[43m,[49m [0;32m 866[0m [43m [49m[43mencoding[49m[38;5;241;43m=[39;49m[43mioargs[49m[38;5;241;43m.[39;49m[43mencoding[49m[43m,[49m [0;32m 867[0m [43m [49m[43merrors[49m[38;5;241;43m=[39;49m[43merrors[49m[43m,[49m [0;32m 868[0m [43m [49m[43mnewline[49m[38;5;241;43m=[39;49m[38;5;124;43m"[39;49m[38;5;124;43m"[39;49m[43m,[49m [0;32m 869[0m [43m [49m[43m)[49m [0;32m 870[0m [38;5;28;01melse[39;00m: [0;32m 871[0m [38;5;66;03m# Binary mode[39;00m [0;32m 872[0m handle [38;5;241m=[39m [38;5;28mopen[39m(handle, ioargs[38;5;241m.[39mmode) [1;31mFileNotFoundError[0m: [Errno 2] No such file or directory: 'C:\\\\Users\\\\HP\\\\Desktop\\\\podyplomówka\\\\gapminder.csv'