10 Reasons to use brackets to select a pandas DataFrame column and NOT dot notation

Опубликовано: 22 Март 2026
на канале: Dunder Data
3,241
56

LEARN DATA SCIENCE WITH PYTHON
• I have several online and in-person courses available on Dunder Data to teach you Python, data science, and machine learning (https://www.dunderdata.com)

ONLINE COURSES
• Master Data Analysis with Python — a comprehensive course with access to over 800 pages of text, 500 exercises, video lessons, multiple projects, and detailed solutions (https://www.dunderdata.com/master-dat...)

• Master the Fundamentals of Python — ver 300 pages of text, 150 exercises, multiple projects and detailed solutions (https://www.dunderdata.com/master-the...)

• Intro to Pandas — FREE course to get started. 5.5 hours of video, nearly 50 exercises (https://www.dunderdata.com/intro-to-p...)

All Access Pass! — Get lifetime access to all current and future online courses for one low price! (https://www.dunderdata.com/all-access...)

IN-PERSON COURSES
Take a hands-on, interactive, in-person class with me (https://www.dunderdata.com/in-person-...)

SOCIAL MEDIA
I frequently post my python data science thoughts on social media. Follow me!
• Twitter @TedPetrou (  / tedpetrou  )
• LinkedIn Ted Petrou (  / tedpetrou  )
• Facebook Dunder Data (  / dunderdata  )

CORPORATE TRAINING
If you have a group at your company looking to learn directly from an expert who understands how to teach and motivate students, let me know by filling out the form on this page. (https://www.dunderdata.com/corporate)

10 Reasons to choose the brackets instead of dot notation
Select column names with spaces
Select column names that have the same name as methods
Select columns with variables
Select non-string columns
Set new columns
Select multiple columns
Dot notation is a strict subset of the brackets
Use one way which works for all situations
Auto-completion works in the brackets and following it
Brackets are the canonical way to select subsets for all objects