DWR Lewis
DWR Lewis

Reputation: 490

Parameter(s) Unfilled error for pandas after updating pycharm

I have some pandas code I was working on in a dummy project I use for testing, and once I figured out this worked, started a new project and pasted the pandas code in. I'm now getting a Parameter(s) Unfilled error for the below script:

import pandas as pd
import os

os.chdir(r'C:\Users\filepath...')


import_columns = ['List',
                  'Of',
                  'Import',
                  'Columns'
                  ]

file_a = pd.read_excel('1.1_A_Dummy Data.xlsx', usecols=lambda x: x in set(import_columns)) # ERROR
print(file_a)

Here is the warning flagged up in Pycharm:

enter image description here

I only get this error for new projects, it wasn't present in the original dummy project I wrote the script in. I've tried a clean install of pycharm and still get this error flagged, even though the code works fine. Is this something to do with the interpreter settings, or new versions of pandas etc? It works perfectly fine but I can't understand why it would be error flagging something that's never popped up whenever I've used read_excel.

EDIT: Here is the interpreter settings, i haven't inherited from global, nad just installed pandas and openpyxl:

enter image description here

Upvotes: 10

Views: 2075

Answers (1)

DWR Lewis
DWR Lewis

Reputation: 490

Okay so I've found something rather odd. sheet_name now just seems to be marked as a mandatory field, rather than an optional, but still runs correctly without it. Adding sheet_name=0 stops the error flags from appearing:

file_a = pd.read_excel('1.1_A_Dummy Data.xlsx', sheet_name=0, usecols=lambda x: x in set(import_columns))

I'm not sure if I can classify this as a "solution", but I'm posting this as an answer. I've searched the pandas changelog for any indication this is a version issue, but have come across nothing. If anyone else has a more thorough explanation feel free to elaborate.

Upvotes: 17

Related Questions