PANDAS FOR DATA SCIENCE

Pandas Columns: Bracket Indexing (df[‘x’]) Versus Dot Syntax (df.x)

Does it matter how you do it? Maybe one is faster than the other?

Marcin Kozak
Towards Data Science
5 min readMar 1, 2024

--

The dot syntax is very popular in Python, also in Pandas. Photo by Alejandro Barba on Unsplash

When using Pandas, most data scientists would go for df['x'] or df["x"] — it doesn’t really matter which one you use as long as you stick to whichever you’ve chosen. You can…

--

--

A full professor, interdisciplinary researcher, data scientist, statistician, Python, R and Go developer, open-source contributor — and a devoted writer