jldbc / jldbc/pybaseball

Fangraphs add league="mnl" data not working

Open
#384 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
Python
Stars
1.7k
Forks
428
PR merge metrics
No merged PRs in 30d

Description

Hi, I followed by [batting_stats](https://github.com/jldbc/pybaseball/blob/master/docs/batting_stats.md) document and tried to use `mnl` to get data but got an error

My Code:
```python
from pybaseball import batting_stats

batting_stats(2023, league="mnl")
```

Error I got:
```
---------------------------------------------------------------------------
AssertionError Traceback (most recent call last)
[/usr/local/lib/python3.10/dist-packages/pandas/core/internals/construction.py](https://localhost:8080/#) in _finalize_columns_and_data(content, columns, dtype)
968 try:
--> 969 columns = _validate_or_indexify_columns(contents, columns)
970 except AssertionError as err:

12 frames
AssertionError: 320 columns passed, passed data had 1 columns

The above exception was the direct cause of the following exception:

ValueError Traceback (most recent call last)
[/usr/local/lib/python3.10/dist-packages/pandas/core/internals/construction.py](https://localhost:8080/#) in _finalize_columns_and_data(content, columns, dtype)
970 except AssertionError as err:
971 # GH#26429 do not raise user-facing AssertionError
--> 972 raise ValueError(err) from err
973
974 if len(contents) and contents[0].dtype == np.object_:

ValueError: 320 columns passed, passed data had 1 columns
```

My environment (Google Colab):
* Python: 3.10.12
* pybaseball: 2.2.7

I guess maybe there are some different from the respond data so the method break since I also tried `all`, `nl` and `al`, they still worked for me.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.