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

Fix some errors. #1865

Merged
merged 1 commit into from
Feb 19, 2024
Merged

Fix some errors. #1865

merged 1 commit into from
Feb 19, 2024

Conversation

cottrell
Copy link
Contributor

Seems like some typos or part of the code never been hit before.

df and df2 must be same shape.

pd.to_datetime() had no argument?

yf.Ticker('rshn').history(start='2000-01-01', end='2024-02-18', repair=True, auto_adjust=True, actions=True)


File ~/anaconda3/envs/3.11/lib/python3.11/site-packages/pandas/core/indexing.py:1414, in _LocIndexer._getitem_axis(self, key, axis)
   1412     return self._get_slice_axis(key, axis=axis)
   1413 elif com.is_bool_indexer(key):
-> 1414     return self._getbool_axis(key, axis=axis)
   1415 elif is_list_like_indexer(key):
   1416     # an iterable multi-selection
   1417     if not (isinstance(key, tuple) and isinstance(labels, MultiIndex)):

File ~/anaconda3/envs/3.11/lib/python3.11/site-packages/pandas/core/indexing.py:1210, in _LocationIndexer._getbool_axis(self, key, axis)
   1206 @final
   1207 def _getbool_axis(self, key, axis: AxisInt):
   1208     # caller is responsible for ensuring non-None axis
   1209     labels = self.obj._get_axis(axis)
-> 1210     key = check_bool_indexer(labels, key)
   1211     inds = key.nonzero()[0]
   1212     return self.obj._take_with_is_copy(inds, axis=axis)

File ~/anaconda3/envs/3.11/lib/python3.11/site-packages/pandas/core/indexing.py:2674, in check_bool_indexer(index, key)
   2670 elif not is_array_like(result):
   2671     # GH 33924
   2672     # key may contain nan elements, check_array_indexer needs bool array
   2673     result = pd_array(result, dtype=bool)
-> 2674 return check_array_indexer(index, result)

File ~/anaconda3/envs/3.11/lib/python3.11/site-packages/pandas/core/indexers/utils.py:539, in check_array_indexer(array, indexer)
    537     # GH26658
    538     if len(indexer) != len(array):
--> 539         raise IndexError(
    540             f"Boolean index has wrong length: "
    541             f"{len(indexer)} instead of {len(array)}"
    542         )
    543 elif is_integer_dtype(dtype):
    544     try:

IndexError: Boolean index has wrong length: 6069 instead of 6070

@ValueRaider
Copy link
Collaborator

Great detective work, I know that repair logic is dense. Can you "rebase" to dev branch? Not sure an actual git rebase will succeed because of PR #1849.

I need to push a fix to repair logic, then will move towards a release.

@cottrell
Copy link
Contributor Author

@ValueRaider patched onto dev

@ValueRaider ValueRaider changed the base branch from main to dev February 19, 2024 21:44
@ValueRaider ValueRaider merged commit ac1d090 into ranaroussi:dev Feb 19, 2024
1 check passed
@cottrell cottrell deleted the fix branch February 20, 2024 10:00
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

Successfully merging this pull request may close these issues.

2 participants