csv file not importing into VS Code using Python & Pandas

170 Views Asked by At

I'm an absolute beginner so if some of what I'm saying makes no sense, I apologize.

I'm trying to import a CSV file by putting this script in:

df = pd.read_csv('708011_daily_ts_Q.csv', sheet_name='Sheet 1')
print(df)

But I keep getting this error message:

TypeError                                 Traceback (most recent call last)
12 # %%
----> 13 df = pd.read_csv('708011_daily_ts_Q.csv', sheet_name='Sheet 1')
15 print(df)


File ~/miniconda3/envs/eh_env/lib/python3.11/site-packages/pandas/util/_decorators.py:211, in deprecate_kwarg.._deprecate_kwarg..wrapper(*args, **kwargs)
209     else:
210         kwargs[new_arg_name] = new_arg_value
--> 211 return func(*args, **kwargs)


File ~/miniconda3/envs/eh_env/lib/python3.11/site-packages/pandas/util/_decorators.py:331, in deprecate_nonkeyword_arguments..decorate..wrapper(*args, **kwargs)
325 if len(args) > num_allow_args:
26     warnings.warn(
327         msg.format(arguments=_format_argument_list(allow_args)),
328         FutureWarning,
329         stacklevel=find_stack_level(),
330     )
--> 331 return func(*args, **kwargs)
      
TypeError: read_csv() got an unexpected keyword argument 'sheet_name'

I'm not sure what is going on.

I also tried to import the file from its link (based on a YT video) but no luck, still the same problem.

0

There are 0 best solutions below