We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Today, we can't type describe some structrure partially. for example, col a and b are ints + I don't care about other columns. Example function:
def add_a_col_in_df(df): df["new_col"] = df["a"] + df["b"] return df
with wildcard on colnames we would make type hints like follows:
from nptyping import DataFrame from nptyping import Structure as S def add_a_col_in_df(df : DataFrame[S["[a, b]: Int, *: Any"]]) -> DataFrame[S["[a, b, new_col]: Int, *: Any"]]: df["new_col"] = df["a"] + df["b"] return df
The text was updated successfully, but these errors were encountered:
There is a release 2.5.0 in the making that will include this. The syntax will be as follows:
from nptyping import DataFrame, Structure as S DataFrame[S["[a, b]: Int, *"]] # <-- a DataFrame with AT LEAST int columns a and b
Sorry, something went wrong.
With v2.5.0 this issue should be resolved. Please let me know if you encounter any problems still.
Successfully merging a pull request may close this issue.
Today, we can't type describe some structrure partially. for example, col a and b are ints + I don't care about other columns.
Example function:
with wildcard on colnames we would make type hints like follows:
The text was updated successfully, but these errors were encountered: