Skip to content

Instantly share code, notes, and snippets.

@brycepg
Created March 1, 2022 16:14
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save brycepg/2b6e2f78bd3f5c810cd96ceffc7b6905 to your computer and use it in GitHub Desktop.
Save brycepg/2b6e2f78bd3f5c810cd96ceffc7b6905 to your computer and use it in GitHub Desktop.
Print out inferred types of DataFrame
import astroid
import astroid; astroid.context.InferenceContext.max_inferred = 500
ret = astroid.extract_node("""
import pandas as pd
df = pd.read_csv("some.csv")
df #@
df.columns
df.columns #
""")
inferred = ret.inferred()
print(inferred)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment