Skip to content

DOC/CLN: how is completely inconsistent #49132

Open
@bashtage

Description

@bashtage

Pandas version checks

  • I have checked that this issue has not already been reported.

  • I have confirmed this bug exists on the latest version of pandas.

  • I have confirmed this bug exists on the main branch of pandas.

Reproducible Example

import pandas as pd

Period("2000Q1").asfreq(Day(), "Finish")
Period("2000Q1").asfreq(Day(), "E")
Period("2000Q1").asfreq(Day(), "End")
Period("2000Q1").asfreq(Day(), "end")

are all the same.



### Issue Description

`Period.asfreq` and `Period.to_timestamp` both technically support the same arguments, which are any case invariant version of

"S",
"E",
"start",
"end",
"Finish",
"Begin",
"End",
"s",
"e",
"finish",
"begin",

The docs do not agree and some say only `S`, `E`, `start`, `end`, which others give the logner list.  

In general `how` frequency conversions should use a single list and all other forms should be deprecated.  The correct list is probably the small one {`S`, `E`, `start`, `end`}. `how` is used in other functions with different lists supported, althought he actual support is the wide list. 


### Expected Behavior

Have a small clear set of values and block others. 

### Installed Versions

<details>

INSTALLED VERSIONS

commit : 87cfe4e
python : 3.9.12.final.0
python-bits : 64
OS : Windows
OS-release : 10
Version : 10.0.22621
machine : AMD64
processor : AMD64 Family 23 Model 113 Stepping 0, AuthenticAMD
byteorder : little
LC_ALL : None
LANG : None
LOCALE : English_United States.1252

pandas : 1.5.0
numpy : 1.23.4
pytz : 2022.4
dateutil : 2.8.2
setuptools : 63.3.0
pip : 22.2.2
Cython : None
pytest : 7.1.3
hypothesis : None
sphinx : None
blosc : None
feather : None
xlsxwriter : None
lxml.etree : 4.8.0
html5lib : None
pymysql : None
psycopg2 : None
jinja2 : 3.1.2
IPython : 8.5.0
pandas_datareader: None
bs4 : None
bottleneck : None
brotli : None
fastparquet : None
fsspec : None
gcsfs : None
matplotlib : 3.5.3
numba : None
numexpr : 2.8.3
odfpy : None
openpyxl : 3.0.10
pandas_gbq : None
pyarrow : 9.0.0
pyreadstat : 1.1.9
pyxlsb : 1.0.9
s3fs : None
scipy : 1.9.2
snappy : None
sqlalchemy : 1.4.41
tables : None
tabulate : 0.9.0
xarray : 2022.9.0
xlrd : 2.0.1
xlwt : None
zstandard : None
tzdata : None

</details>

Metadata

Metadata

Assignees

No one assigned

    Labels

    CleanDocsNeeds DiscussionRequires discussion from core team before further action

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions