Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

pdf_converter cdqa throws AttributeError: type object 'object' has no attribute 'dtype' #372

Open
Meenakshi-Devi opened this issue Jul 20, 2023 · 0 comments

Comments

@Meenakshi-Devi
Copy link


AttributeError Traceback (most recent call last)
/tmp/ipykernel_55/1136373057.py in
----> 1 df = pdf_converter(directory_path='./data/pdf/')
2 df.head()

/srv/conda/envs/notebook/lib/python3.7/site-packages/cdqa/utils/converters.py in pdf_converter(directory_path, min_length, include_line_breaks)
167 if file.endswith("pdf"):
168 list_pdf.append(file)
--> 169 df = pd.DataFrame(columns=["title", "paragraphs"])
170 for i, pdf in enumerate(list_pdf):
171 try:

/srv/conda/envs/notebook/lib/python3.7/site-packages/pandas/core/frame.py in init(self, data, index, columns, dtype, copy)
408 )
409 elif isinstance(data, dict):
--> 410 mgr = init_dict(data, index, columns, dtype=dtype)
411 elif isinstance(data, ma.MaskedArray):
412 import numpy.ma.mrecords as mrecords

/srv/conda/envs/notebook/lib/python3.7/site-packages/pandas/core/internals/construction.py in init_dict(data, index, columns, dtype)
240 else:
241 nan_dtype = dtype
--> 242 val = construct_1d_arraylike_from_scalar(np.nan, len(index), nan_dtype)
243 arrays.loc[missing] = [val] * missing.sum()
244

/srv/conda/envs/notebook/lib/python3.7/site-packages/pandas/core/dtypes/cast.py in construct_1d_arraylike_from_scalar(value, length, dtype)
1219 else:
1220 if not isinstance(dtype, (np.dtype, type(np.dtype))):
-> 1221 dtype = dtype.dtype
1222
1223 if length and is_integer_dtype(dtype) and isna(value):

AttributeError: type object 'object' has no attribute 'dtype'

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant