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

Typing: Narrow down types of arguments (NDFrame) #10

Closed
24 tasks done
phofl opened this issue Apr 18, 2023 · 6 comments
Closed
24 tasks done

Typing: Narrow down types of arguments (NDFrame) #10

phofl opened this issue Apr 18, 2023 · 6 comments

Comments

@phofl
Copy link
Collaborator

phofl commented Apr 18, 2023

We prefer using Literal["a"] | Literal["b"] instead of str. Look into the documentation what is allowed and the narrow the types down appropriately. Generally, we probably already have type definitions in pandas/_typing.py like NaPosition for the first item in the list below.

You can locate the appropriate file through searching for class NDFrame in the repository (This is the base class for Series and DataFrame).

NDFrame methods:

  • Specify closed in rolling more precisely
  • Specify method in expanding more precisely
  • Specify method in ewm more precisely
  • Specify engine in to_excel more precisely
  • Specify orient in to_json more precisely
  • Specify date_unit in to_json more precisely
  • Specify errors in to_hdf more precisely
  • Specify mode in to_hdf more precisely
  • Specify complib in to_hdf more precisely
  • Specify format in to_hdf more precisely
  • Specify method in to_sql more precisely
  • Specify errors in to_csv more precisely
  • Specify mode in to_csv more precisely
  • Specify kind and na_position in sort_values more precisely
  • Specify method in reindex more precisely
  • Specify method in interpolate more precisely
  • Specify limit_direction in interpolate more precisely
  • Specify limit_area in interpolate more precisely
  • Specify how in asfreq more precisely
  • Specify closed in resample more precisely
  • Specify convention in resample more precisely
  • Specify kind in resample more precisely
  • Specify method in rank more precisely
  • Specify na_option in rank more precisely
@YYYasin19
Copy link

YYYasin19 commented Apr 18, 2023

I'll take the first 5 :)

@maanijou
Copy link

I'll take the last 5 :)

@mKlepsch
Copy link

I'll take the 6 to 10 :
Specify date_unit in to_json more precisely
Specify errors in to_hdf more precisely
Specify mode in to_hdf more precisely
Specify complib in to_hdf more precisely
Specify format in to_hdf more precisely

@kevinanker
Copy link

kevinanker commented Apr 18, 2023

Okay, I'll go with 11-15:

  • Specify method in to_sql more precisely
  • Specify errors in to_csv more precisely
  • Specify mode in to_csv more precisely
  • Specify kind and na_position in sort_values more precisely
  • Specify method in reindex more precisely

@VanMyHu
Copy link

VanMyHu commented Apr 18, 2023

I'll go with 16 and 17:
Specify method in interpolate more precisely
Specify limit_direction in interpolate more precisely

@kevx82
Copy link

kevx82 commented Apr 18, 2023

I'll take 18 to 19:

Specify limit_area in interpolate more precisely
Specify how in asfreq more precisely

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

No branches or pull requests

8 participants