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

refactor: Clean "(P)" in front of Moody's ratings #27

Closed
a-vester opened this issue Dec 5, 2022 · 0 comments · Fixed by #28
Closed

refactor: Clean "(P)" in front of Moody's ratings #27

a-vester opened this issue Dec 5, 2022 · 0 comments · Fixed by #28
Assignees
Labels
enhancement New feature or request refactor Refactoring code without introducing new features.

Comments

@a-vester
Copy link
Member

a-vester commented Dec 5, 2022

Some agencies attach a rating without having been requested by the issuer. This is usually indicated by the attachment of the letter u (unsolicited), e.g. AA+u.

Moody's uses (P) (public information only) before the actual rating, e.g. (P)P-1.

Add the possibility to use get_pure_ratings in order to clean (P).

def get_pure_ratings(
ratings: Union[str, pd.Series, pd.DataFrame]
) -> Union[str, pd.Series, pd.DataFrame]:
"""Remove rating watches/outlooks.
Parameters
----------
ratings
Rating may contain watch, such as `AA- *+`, `BBB+ (CwNegative)`.
Outlook/watch should be seperated by a blank from the actual rating.
Returns
-------
Union[str, pd.Series, pd.DataFrame]
Regular ratings stripped off of watches. The name of the resulting Series or
the columns of the returning DataFrame will be suffixed with `_clean`.

@a-vester a-vester added the enhancement New feature or request label Dec 5, 2022
@a-vester a-vester changed the title feat: Clean "(P)" in front of Moody's ratings refactor: Clean "(P)" in front of Moody's ratings Dec 5, 2022
@a-vester a-vester added the refactor Refactoring code without introducing new features. label Dec 5, 2022
a-vester added a commit that referenced this issue Dec 5, 2022
Some ratings may have a prefix '(P)', which indicates that this rating
is based on public information only. It is comparable to the suffix 'u'
(unsolicited).

This commit improved ``get_pure_ratings`` in order to
also remove this kind of prefix.

Closes #27
@a-vester a-vester self-assigned this Dec 5, 2022
a-vester added a commit that referenced this issue Dec 6, 2022
…28)

Some ratings may have a prefix '(P)', which indicates that this rating
is based on public information only. It is comparable to the suffix 'u'
(unsolicited).

This commit improved ``get_pure_ratings`` in order to
also remove this kind of prefix.

Closes #27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request refactor Refactoring code without introducing new features.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant