{
  "source_file": "0930",
  "source_platform": "Medium",
  "author": "Ibrahim Salami",
  "title_listed": "I Rewrote a Real Data Workflow in Polars. Pandas Didn't Stand a Chance.",
  "keywords": "",
  "domain": "数据处理",
  "content_type": "深度技术解析",
  "is_paid_flag": "否",
  "url": "https://towardsdatascience.com/i-rewrote-a-real-data-workflow-in-polars-pandas-didnt-stand-a-chance/",
  "publish_date": "2026-05-07",
  "corpus_stage": "",
  "notes": "",
  "id": "a36be007b304",
  "collected_at": "2026-10-02T11:41:38",
  "title": "I Rewrote a Real Data Workflow in Polars. Pandas Didn’t Stand a Chance. | Towards Data Science",
  "body_markdown": "![Revisit consent button](../images/body-df29beacd7496220cc94.svg)\nWe value your privacy\nWe use cookies to enhance your browsing experience, serve personalised ads or content, and analyse our traffic. By clicking \"Accept All\", you consent to our use of cookies.\nCustomise Reject All Accept All\nCustomise Consent Preferences ![](../images/body-2159bb67f3de8ad870eb.svg)\nWe use cookies to help you navigate efficiently and perform certain functions. You will find detailed information about all cookies under each consent category below.\nThe cookies that are categorised as \"Necessary\" are stored on your browser as they are essential for enabling the basic functionalities of the site. ... Show more\nNecessaryAlways Active\nNecessary cookies are required to enable the basic features of this site, such as providing secure log-in or adjusting your consent preferences. These cookies do not store any personally identifiable data.\n  * Cookie\nBCTempID\n  * Duration\n10 minutes\n  * Description\nNo description available.\n\n\n  * Cookie\n__cf_bm\n  * Duration\n1 hour\n  * Description\nThis cookie, set by Cloudflare, is used to support Cloudflare Bot Management. \n\n\n  * Cookie\nAWSALBCORS\n  * Duration\n7 days\n  * Description\nAmazon Web Services set this cookie for load balancing.\n\n\n  * Cookie\n_cfuvid\n  * Duration\nsession\n  * Description\nCloudflare sets this cookie to track users across sessions to optimize user experience by maintaining session consistency and providing personalized services\n\n\n  * Cookie\nli_gc\n  * Duration\n6 months\n  * Description\nLinkedin set this cookie for storing visitor's consent regarding using cookies for non-essential purposes.\n\n\n  * Cookie\n__hssrc\n  * Duration\nsession\n  * Description\nThis cookie is set by Hubspot whenever it changes the session cookie. The __hssrc cookie set to 1 indicates that the user has restarted the browser, and if the cookie does not exist, it is assumed to be a new session.\n\n\n  * Cookie\n__hssc\n  * Duration\n1 hour\n  * Description\nHubSpot sets this cookie to keep track of sessions and to determine if HubSpot should increment the session number and timestamps in the __hstc cookie.\n\n\n  * Cookie\nwpEmojiSettingsSupports\n  * Duration\nsession\n  * Description\nWordPress sets this cookie when a user interacts with emojis on a WordPress site. It helps determine if the user's browser can display emojis properly.\n\n\n  * Cookie\nBCSessionID\n  * Duration\n1 year 1 month 4 days\n  * Description\nBlueconic sets this cookie as a unique identifier for the BlueConic profile.\n\n\n  * Cookie\n_octo\n  * Duration\n1 year\n  * Description\nNo description available.\n\n\n  * Cookie\nlogged_in\n  * Duration\n1 year\n  * Description\nNo description available.\n\n\n  * Cookie\n__Secure-YEC\n  * Duration\npast\n  * Description\nYouTube sets this cookie to stores the user's video player preferences using embedded YouTube video\n\n\n  * Cookie\n__eoi\n  * Duration\n6 months\n  * Description\nDescription is currently not available.\n\n\n  * Cookie\nAWSALBTGCORS\n  * Duration\n7 days\n  * Description\nNo description available.\n\n\n  * Cookie\nlogin-status-p\n  * Duration\npast\n  * Description\nDescription is currently not available.\n\n\n  * Cookie\nAWSALBTG\n  * Duration\n7 days\n  * Description\nNo description available.\n\n\n  * Cookie\ncsrf_token\n  * Duration\nsession\n  * Description\nNo description available.\n\n\n  * Cookie\ntoken_v2\n  * Duration\n1 day\n  * Description\nDescription is currently not available.\n\n\n  * Cookie\nD\n  * Duration\n1 year\n  * Description\nDescription is currently not available.\n\n\n  * Cookie\nPHPSESSID\n  * Duration\nsession\n  * Description\nThis cookie is native to PHP applications. The cookie stores and identifies a user's unique session ID to manage user sessions on the website. The cookie is a session cookie and will be deleted when all the browser windows are closed.\n\n\n  * Cookie\nVISITOR_PRIVACY_METADATA\n  * Duration\n6 months\n  * Description\nYouTube sets this cookie to store the user's cookie consent state for the current domain. \n\n\n  * Cookie\ncookietest\n  * Duration\nsession\n  * Description\nThe cookietest cookie is typically used to determine whether the user's browser accepts cookies, essential for website functionality and user experience.\n\n\n  * Cookie\n__Host-airtable-session\n  * Duration\n1 year\n  * Description\nThis cookie is used to enable us to integrate the services of Airtable.\n\n\n  * Cookie\n__Host-airtable-session.sig\n  * Duration\n1 year\n  * Description\nThis cookie is used to enable us to integrate the services of Airtable.\n\n\n  * Cookie\nm\n  * Duration\n1 year 1 month 4 days\n  * Description\nStripe sets this cookie for fraud prevention purposes. It identifies the device used to access the website, allowing the website to be formatted accordingly.\n\n\n  * Cookie\nBIGipServer*\n  * Duration\nsession\n  * Description\nMarketo sets this cookie to collect information about the user's online activity and build a profile about their interests to provide advertisements relevant to the user. \n\n\n  * Cookie\n__cfruid\n  * Duration\nsession\n  * Description\nCloudflare sets this cookie to identify trusted web traffic.\n\n\n  * Cookie\n_GRECAPTCHA\n  * Duration\n6 months\n  * Description\nGoogle Recaptcha service sets this cookie to identify bots to protect the website against malicious spam attacks.\n\n\n  * Cookie\n__Secure-YNID\n  * Duration\n6 months\n  * Description\nGoogle cookie used to protect user security and prevent fraud, especially during the login process.\n\n\n  * Cookie\ncookieyes-consent\n  * Duration\n1 year\n  * Description\nCookieYes sets this cookie to remember users' consent preferences so that their preferences are respected on subsequent visits to this site. It does not collect or store any personal information about the site visitors.\n\n\nFunctional\nFunctional cookies help perform certain functionalities like sharing the content of the website on social media platforms, collecting feedback, and other third-party features.\n  * Cookie\nlidc\n  * Duration\n1 day\n  * Description\nLinkedIn sets the lidc cookie to facilitate data center selection.\n\n\n  * Cookie\nbrw\n  * Duration\n1 year\n  * Description\nNo description available.\n\n\n  * Cookie\nbrwConsent\n  * Duration\n5 minutes\n  * Description\nDescription is currently not available.\n\n\n  * Cookie\nWMF-Uniq\n  * Duration\n1 year\n  * Description\nDescription is currently not available.\n\n\n  * Cookie\nloom_anon_comment\n  * Duration\n1 year\n  * Description\nNo description available.\n\n\n  * Cookie\nloom_referral_video\n  * Duration\nsession\n  * Description\nDescription is currently not available.\n\n\n  * Cookie\nVISITOR_INFO1_LIVE\n  * Duration\n6 months\n  * Description\nA cookie set by YouTube to measure bandwidth that determines whether the user gets the new or old player interface.\n\n\n  * Cookie\nyt-remote-connected-devices\n  * Duration\nNever Expires\n  * Description\nYouTube sets this cookie to store the user's video preferences using embedded YouTube videos.\n\n\n  * Cookie\nytidb::LAST_RESULT_ENTRY_KEY\n  * Duration\nNever Expires\n  * Description\nThe cookie ytidb::LAST_RESULT_ENTRY_KEY is used by YouTube to store the last search result entry that was clicked by the user. This information is used to improve the user experience by providing more relevant search results in the future.\n\n\n  * Cookie\nyt-remote-device-id\n  * Duration\nNever Expires\n  * Description\nYouTube sets this cookie to store the user's video preferences using embedded YouTube videos.\n\n\n  * Cookie\nyt-remote-session-name\n  * Duration\nsession\n  * Description\nThe yt-remote-session-name cookie is used by YouTube to store the user's video player preferences using embedded YouTube video.\n\n\n  * Cookie\nyt-remote-fast-check-period\n  * Duration\nsession\n  * Description\nThe yt-remote-fast-check-period cookie is used by YouTube to store the user's video player preferences for embedded YouTube videos.\n\n\n  * Cookie\nyt-remote-session-app\n  * Duration\nsession\n  * Description\nThe yt-remote-session-app cookie is used by YouTube to store user preferences and information about the interface of the embedded YouTube video player.\n\n\n  * Cookie\nyt-remote-cast-available\n  * Duration\nsession\n  * Description\nThe yt-remote-cast-available cookie is used to store the user's preferences regarding whether casting is available on their YouTube video player.\n\n\n  * Cookie\nyt-remote-cast-installed\n  * Duration\nsession\n  * Description\nThe yt-remote-cast-installed cookie is used to store the user's video player preferences using embedded YouTube video.\n\n\n  * Cookie\ncp_session\n  * Duration\n3 months\n  * Description\nCodepen sets this cookie for Help systems found in the website.\n\n\n  * Cookie\nloid\n  * Duration\n1 year 1 month 4 days\n  * Description\nThis cookie is set by the Reddit. The cookie enables the sharing of content from the website onto the social media platform.\n\n\nAnalytics\nAnalytical cookies are used to understand how visitors interact with the website. These cookies help provide information on metrics such as the number of visitors, bounce rate, traffic source, etc.\n  * Cookie\n__hstc\n  * Duration\n6 months\n  * Description\nHubspot set this main cookie for tracking visitors. It contains the domain, initial timestamp (first visit), last timestamp (last visit), current timestamp (this visit), and session number (increments for each subsequent session).\n\n\n  * Cookie\nhubspotutk\n  * Duration\n6 months\n  * Description\nHubSpot sets this cookie to keep track of the visitors to the website. This cookie is passed to HubSpot on form submission and used when deduplicating contacts.\n\n\n  * Cookie\n_ga\n  * Duration\n1 year 1 month 4 days\n  * Description\nGoogle Analytics sets this cookie to calculate visitor, session and campaign data and track site usage for the site's analytics report. The cookie stores information anonymously and assigns a randomly generated number to recognise unique visitors.\n\n\n  * Cookie\n_ga_*\n  * Duration\n1 year 1 month 4 days\n  * Description\nGoogle Analytics sets this cookie to store and count page views.\n\n\n  * Cookie\n__Host-psifi.analyticsTrace\n  * Duration\n6 hours\n  * Description\nDescription is currently not available.\n\n\n  * Cookie\n__Host-psifi.analyticsTraceV2\n  * Duration\n6 hours\n  * Description\nDescription is currently not available.\n\n\n  * Cookie\n_gh_sess\n  * Duration\nsession\n  * Description\nGitHub sets this cookie for temporary application and framework state between pages like what step the user is on in a multiple step form.\n\n\n  * Cookie\nYSC\n  * Duration\nsession\n  * Description\nYSC cookie is set by Youtube and is used to track the views of embedded videos on Youtube pages.\n\n\n  * Cookie\najs_anonymous_id\n  * Duration\n1 year\n  * Description\nThis cookie is set by Segment to count the number of people who visit a certain site by tracking if they have visited before.\n\n\n  * Cookie\nvuid\n  * Duration\n1 year 1 month 4 days\n  * Description\nVimeo installs this cookie to collect tracking information by setting a unique ID to embed videos on the website. \n\n\nPerformance\nPerformance cookies are used to understand and analyse the key performance indexes of the website which helps in delivering a better user experience for the visitors.\n  * Cookie\nAWSALB\n  * Duration\n7 days\n  * Description\nAWSALB is an application load balancer cookie set by Amazon Web Services to map the session to the target.\n\n\n  * Cookie\nacq\n  * Duration\npast\n  * Description\nDescription is currently not available.\n\n\n  * Cookie\nacq.sig\n  * Duration\npast\n  * Description\nDescription is currently not available.\n\n\n  * Cookie\nptc\n  * Duration\n2 years\n  * Description\nNo description available.\n\n\nAdvertisement\nAdvertisement cookies are used to provide visitors with customised advertisements based on the pages you visited previously and to analyse the effectiveness of the ad campaigns.\n  * Cookie\nmuc_ads\n  * Duration\n1 year 1 month 4 days\n  * Description\nTwitter sets this cookie to collect user behaviour and interaction data to optimize the website.\n\n\n  * Cookie\nguest_id_marketing\n  * Duration\n1 year 1 month 4 days\n  * Description\nTwitter sets this cookie to identify and track the website visitor.\n\n\n  * Cookie\nguest_id_ads\n  * Duration\n1 year 1 month 4 days\n  * Description\nTwitter sets this cookie to identify and track the website visitor.\n\n\n  * Cookie\npersonalization_id\n  * Duration\n1 year 1 month 4 days\n  * Description\nTwitter sets this cookie to integrate and share features for social media and also store information about how the user uses the website, for tracking and targeting.\n\n\n  * Cookie\nguest_id\n  * Duration\n1 year 1 month 4 days\n  * Description\nTwitter sets this cookie to identify and track the website visitor. It registers if a user is signed in to the Twitter platform and collects information about ad preferences.\n\n\n  * Cookie\nbcookie\n  * Duration\n1 year\n  * Description\nLinkedIn sets this cookie from LinkedIn share buttons and ad tags to recognize browser IDs.\n\n\n  * Cookie\n__Secure-ROLLOUT_TOKEN\n  * Duration\n6 months\n  * Description\nYouTube sets this cookie to manage feature rollout and experimentation. It helps Google control which new features or interface changes are shown to users as part of testing and staged rollouts, ensuring consistent experience for a given user during an experiment.\n\n\n  * Cookie\nyt.innertube::nextId\n  * Duration\nNever Expires\n  * Description\nYouTube sets this cookie to register a unique ID to store data on what videos from YouTube the user has seen.\n\n\n  * Cookie\nyt.innertube::requests\n  * Duration\nNever Expires\n  * Description\nYouTube sets this cookie to register a unique ID to store data on what videos from YouTube the user has seen.\n\n\n  * Cookie\nsession_tracker\n  * Duration\nsession\n  * Description\nThis cookie is set by the Reddit. This cookie is used to identify trusted web traffic. It also helps in adverstising on the website.\n\n\n  * Cookie\nedgebucket\n  * Duration\nsession\n  * Description\nReddit sets this cookie to save the information about a log-on Reddit user, for the purpose of advertisement recommendations and updating the content.\n\n\n  * Cookie\ndid\n  * Duration\n1 year\n  * Description\nArbor sets this cookie to show targeted ads to site visitors.This cookie expires after 2 months or 1 year.\n\n\nUncategorised\nOther uncategorised cookies are those that are being analysed and have not been classified into a category as yet.\nNo cookies to display.\nReject All Save My Preferences Accept All\nToggle Search[](https://towardsdatascience.com/)Toggle Mobile Navigation\n[](https://towardsdatascience.com/)\nPublish AI, ML & data-science insights to a global community of data professionals.\nSign in[Submit an Article](https://write.insightmediagroup.io)\n[Latest](https://towardsdatascience.com/latest/)[Editor's Picks](https://towardsdatascience.com/tag/editors-pick/)[Newsletter](https://towardsdatascience.com/tag/the-variable/)[ShipAI](https://towardsdatascience.com/shipai/)\n* * *\n[Write For TDS](https://towardsdatascience.com/submissions/)\n[LinkedIn](https://www.linkedin.com/company/towards-data-science/)[X](https://x.com/TDataScience)Toggle Search\n[Data Science](https://towardsdatascience.com/category/data-science/)\n# I Rewrote a Real Data Workflow in Polars. Pandas Didn’t Stand a Chance.\nFrom 61 seconds to 0.20 seconds — and the mental model shift I didn't expect\n[Ibrahim Salami](https://towardsdatascience.com/author/ibrahim.salami/)\nMay 7, 202614 min read\n![](../images/000.jpg)\nCreated with Gemini AI\nI'll be honest — I wasn't actively looking for Polars.\nI've been on a bit of a Pandas optimization journey lately. First, I wrote about why you should [stop writing loops in Pandas](https://towardsdatascience.com/stop-writing-loops-in-pandas-do-this-instead/) and think in columns instead.\nThen I went deeper to profiling real workflows, fixing vectorization mistakes, and ended up cutting a [61-second pipeline down to 0.33 seconds](https://towardsdatascience.com/i-reduced-my-pandas-runtime-by-95-heres-what-i-was-doing-wrong/) using nothing but better Pandas and NumPy. That one surprised even me.\nSo I was in a good place with Pandas. I felt like I finally understood how to use it properly.\nThen someone dropped a comment on one of my posts. Something along the lines of: _\"Have you tried Polars? It's built for exactly this kind of thing.\"_\nI'd seen the name floating around in the data community. There was buzz around it — something about speed, about a completely different way of thinking about data pipelines. But I'd never actually touched it.\nThat comment was enough to push me over the edge.\nSo I did what I always do. I got curious, I installed it, and I rewrote the exact same workflow from my last article, the one I'd already optimized in Pandas, in a tool I'd never used before.\nWhat I found surprised me. Not just the speed numbers, but what Polars quietly teaches you about how data pipelines actually work.\nLearn this step by step with the interactive [AI and Data Scientist](https://roadmap.sh/ai-data-scientist) roadmap.\n## **Isn't Pandas Enough?**\nFair question.\nIn my last article, I took a slow Pandas pipeline and optimized it down to 0.33 seconds. Vectorized operations, correct data types, no unnecessary copies. The results were honestly better than I expected.\nSo why are we even talking about Polars?\nHere's the thing. Everything I did in that article was me doing the optimization manually. I had to know which operations were slow, why they were slow, and how to fix them. Polars does a lot of that thinking for you automatically, before it even runs your code.\nOn top of that, Polars is built on a completely different foundation than Pandas. It uses all your CPU cores by default. It manages memory differently. And it introduces a way of writing data pipelines that, once it clicks, changes how you think about the whole process.\nOptimized Pandas is impressive. But it still has a ceiling. This article is about what's on the other side of it.\n## **The Workflow**\nTo keep things consistent and useful for anyone who followed along with my last article. I'm using the same synthetic e-commerce dataset. One million rows. Nothing exotic. Just the kind of data you'd realistically encounter in the wild.\nIf you want to generate it yourself, here's the setup code:\npython\n\n```\nimport pandas as pd\nimport numpy as np\nimport time\n\nnp.random.seed(42)\n\nn = 1_000_000\n\nregions = ['north', 'south', 'east', 'west']\ncategories = ['electronics', 'clothing', 'furniture', 'food', 'sports']\nstatuses = ['completed', 'returned', 'pending', 'cancelled']\n\ndf = pd.DataFrame({\n    'order_id': np.arange(1000, 1000 + n),\n    'order_date': pd.date_range(start='2022-01-01', periods=n, freq='1min'),\n    'region': np.random.choice(regions, size=n),\n    'category': np.random.choice(categories, size=n),\n    'sales': np.random.randint(100, 10000, size=n),\n    'quantity': np.random.randint(1, 20, size=n),\n    'discount': np.round(np.random.uniform(0.0, 0.5, size=n), 2),\n    'status': np.random.choice(statuses, size=n),\n})\n\ndf.to_csv('large_sales_data.csv', index=False)\n```\n\nThe pipeline we're running on it is straightforward. The kind of thing that shows up in real workflows all the time:\n  * Fix data types upfront\n  * Calculate net revenue per order\n  * Flag high-value orders\n  * Aggregate total net revenue by region\n\n\nSimple. Familiar. And already optimized in Pandas from the last article, which makes it the perfect benchmark for Polars.\n## **The Pandas Version**\nI'm not going to show you the naive Pandas code here. I already did that in my last article — the version with three `.apply()` calls that took 61 seconds on this same dataset. If you haven't read that one, it's worth a look.\nWhat I'm showing here is the optimized version. The best Pandas can do on this pipeline.\npython\n\n```\nimport pandas as pd\nimport numpy as np\nimport time\n\ndf = pd.read_csv('large_sales_data.csv')\n\nstart = time.time()\n\n# Fix data types upfront\ndf['region'] = df['region'].astype('category')\ndf['category'] = df['category'].astype('category')\ndf['status'] = df['status'].astype('category')\n\n# Vectorized revenue calculation\ndf['net_revenue'] = df['sales'] * df['quantity'] * (1 - 0.075)\n\n# Vectorized flagging\ndf['order_flag'] = np.where(df['net_revenue'] > 50000, 'high', 'low')\n\n# Aggregation\nresult = df.groupby('region')['net_revenue'].sum()\n\nend = time.time()\nprint(f\"Pandas runtime: {end - start:.2f} seconds\")\nprint(result)\n```\n\nThis is clean Pandas. Vectorized operations, correct data types, no unnecessary intermediate columns. Everything I learned from going down that rabbit hole.\nAnd the result?\ntext\n\n```\nPandas runtime: 0.31 seconds\n```\n\nThat's already really good. Genuinely impressive for a million rows.  \nBut here's the question I kept sitting with after seeing that number: what does it look like when the tool is doing the optimization for you, instead of you doing it manually?\nThat's what we're about to find out.\n## **Installing Polars and First Impressions**\nGetting started was straightforward. If you're on Google Colab like me, one line is all you need:\npython\n\n```\n!pip install polars \nimport polars as pl \nprint(pl.__version__)\n```\n\ntext\n\n```\n1.35.2\n```\n\nDone. No environment headaches, no dependency conflicts. That alone was a good start.\nBut then I opened the Polars documentation and immediately noticed something. The syntax looked familiar enough — DataFrames, columns, filtering — but the way you're supposed to _think_ about operations felt different. \nIn Pandas, you work with your data step by step. You do something, store the result, do something else. In Polars, you describe what you want as a single expression, and Polars figures out how to execute it.\nI didn't fully understand that yet. But I was about to.\nThe other thing that caught my eye immediately was this concept of **lazy** vs **eager** execution. In Pandas, every line of code runs the moment you write it. Polars gives you a choice: you can run eagerly like Pandas, or you can build up a full query plan first and let Polars optimize it before executing anything.\nI didn't know what that meant in practice yet. But I kept seeing it everywhere in the docs. So I decided the best way to understand it was to just rewrite my pipeline and see what happened.\n## **The Eager Version**\npython\n\n```\nimport polars as pl\nimport time\n\nstart = time.time()\n\nresult = (\n    pl.read_csv('large_sales_data.csv')\n    .with_columns([\n        (pl.col('sales') * pl.col('quantity') * (1 - 0.075)).alias('net_revenue')\n    ])\n    .with_columns([\n        pl.when(pl.col('net_revenue') > 50000)\n        .then(pl.lit('high'))\n        .otherwise(pl.lit('low'))\n        .alias('order_flag')\n    ])\n    .group_by('region')\n    .agg(pl.col('net_revenue').sum())\n)\n\nend = time.time()\nprint(f\"Polars Eager runtime: {end - start:.2f} seconds\")\nprint(result)\n```\n\ntext\n\n```\nPolars Eager runtime: 0.83 seconds\n```\n\nThe first thing I noticed was the method chaining. In Pandas, I was making separate assignments, doing one thing, storing the result, doing the next thing.\nHere, everything flows as a single expression from start to finish. You're describing the entire pipeline at once.\nLet me break down the syntax quickly since some of it will look unfamiliar:\n  * `pl.read_csv()` — reads the CSV, same concept as `pd.read_csv()`. Nothing surprising.\n  * `.with_columns([...])` — this is how Polars adds or transforms columns. The equivalent of `df['new_col'] = ...` in Pandas. You can compute multiple columns in a single call.\n  * `pl.col('sales')` — this is how you reference a column in Polars. Instead of `df['sales']`, you write `pl.col('sales')`. You're not grabbing the data directly — you're describing an operation on that column. That distinction matters more than it sounds.\n  * `.alias('net_revenue')` — just naming the result. Like saying \"call this new column net_revenue.\"\n  * `pl.when(...).then(...).otherwise(...)` — Polars' version of `np.where()`. Reads almost like plain English: when this condition is true, return this value, otherwise return that one.\n  * `.group_by('region').agg(...)` — same concept as Pandas `.groupby()`. Group the data, then define your aggregation. Different syntax, same idea.\n\n\nNow here's the thing. That eager version ran in 0.83 seconds. That's actually slower than our optimized Pandas at 0.31 seconds. If I'd stopped here, I'd have written Polars off entirely.\nBut I kept reading the docs. And I found something called lazy evaluation.\n## **The Lazy Version**\npython\n\n```\nstart = time.time()\n\nresult = (\n    pl.scan_csv('large_sales_data.csv')\n    .with_columns([\n        (pl.col('sales') * pl.col('quantity') * (1 - 0.075)).alias('net_revenue')\n    ])\n    .with_columns([\n        pl.when(pl.col('net_revenue') > 50000)\n        .then(pl.lit('high'))\n        .otherwise(pl.lit('low'))\n        .alias('order_flag')\n    ])\n    .group_by('region')\n    .agg(pl.col('net_revenue').sum())\n    .collect()\n)\n\nend = time.time()\nprint(f\"Polars Lazy runtime: {end - start:.2f} seconds\")\nprint(result)\n```\n\ntext\n\n```\nPolars Lazy runtime: 0.20 seconds\n```\n\nSpot the two differences from the eager version. `pl.read_csv()` became `pl.scan_csv()` — this tells Polars not to load anything yet, just start building a query plan. And `.collect()` was added at the end — that's where you tell Polars \"okay, now execute everything.\"\nTwo changes. That's it.\nAnd just like that, 0.83 seconds became 0.20 seconds.\nPolars lazy is 35% faster than our already optimized Pandas pipeline. Without me doing any manual optimization. Without me profiling anything. Without me knowing in advance which operations were bottlenecks.\nPolars figured that out on its own.\nThat's when I started paying attention.\n## **Mental Model Shift #1 — Lazy vs Eager Execution**\nThis is the one that changed how I think about data pipelines.  \nIn Pandas, every line of code executes the moment you write it. You assign a column — it runs. You filter a DataFrame — it runs. You group and aggregate — it runs. \nEach operation is independent, immediate, and unaware of what comes before or after it.\nThat's eager execution. It's intuitive. It feels natural because it matches how we think about writing code step by step.\nPolars gives you a choice.\nWhen you use `pl.scan_csv()` instead of `pl.read_csv()`, you're telling Polars: _don't execute anything yet._ Just start building a plan. Every `.with_columns()`, every `.filter()`, every `.group_by()` you chain after that isn't running — it's being recorded. You're describing what you want, not triggering it.\nThen when you call `.collect()` at the end, Polars takes that entire plan, looks at it as a whole, optimizes it, and then executes it in one efficient pass.\nThink of it this way:\n  * **Pandas** is like following a recipe step by step. Chop the onions. Put them in the pan. Add the garlic. Each instruction happens immediately, in order, one at a time.\n  * **Polars lazy** is like a chef who reads the entire recipe first, figures out the most efficient way to prepare everything, and then executes it in the optimal order. Same result. Less wasted effort.\n\n\nThat optimization step is the key. Before Polars runs a single line of your pipeline it asks: what columns do we actually need? What rows can we eliminate early? What operations can be parallelized? What work can be skipped entirely?\nYou can actually see the query plan Polars builds before it executes.\nRun this:\npython\n\n```\nlazy_query = (\n    pl.scan_csv('large_sales_data.csv')\n    .with_columns([\n        (pl.col('sales') * pl.col('quantity') * (1 - 0.075)).alias('net_revenue')\n    ])\n    .with_columns([\n        pl.when(pl.col('net_revenue') > 50000)\n        .then(pl.lit('high'))\n        .otherwise(pl.lit('low'))\n        .alias('order_flag')\n    ])\n    .group_by('region')\n    .agg(pl.col('net_revenue').sum())\n)\n\nprint(lazy_query.explain())\n```\n\nThat `.explain()` call shows you exactly what Polars is planning to do before it does it. It's the optimizer's thinking made visible.  \nThis is something Pandas simply doesn't have. \nIn Pandas, the optimization is your responsibility. You have to know which operations are expensive, profile your code, and restructure it manually — which is exactly what I did in my last article. In Polars lazy mode, the optimizer handles that for you.\nThat's not a small difference. That's a fundamentally different relationship between you and your data pipeline.\n## **Mental Model Shift #2 — Query Optimization**\nOnce I understood lazy evaluation, I started wondering — okay, but what exactly is Polars optimizing? What is it actually doing differently under the hood?\nTurns out there are two big ones worth knowing about. And once you understand them, you start seeing why Polars is faster not just on this pipeline, but on almost any non-trivial workflow.\n### **Predicate Pushdown**\nLet's say you add a filter to our pipeline — you only want completed orders:\npython\n\n```\nresult = (\n    pl.scan_csv('large_sales_data.csv')\n    .with_columns([\n        (pl.col('sales') * pl.col('quantity') * (1 - 0.075)).alias('net_revenue')\n    ])\n    .filter(pl.col('status') == 'completed')\n    .group_by('region')\n    .agg(pl.col('net_revenue').sum())\n    .collect()\n)\n```\n\nIn eager mode — Pandas or Polars eager — this is what happens: load all one million rows, compute net revenue for all of them, then filter down to completed orders. You did expensive work on rows you were going to throw away anyway.\nPolars lazy does something smarter. It looks at the entire query plan and says: there's a filter here. Let me apply that filter as early as possible — ideally before loading data, or right after. That way I'm only doing the expensive computations on the rows that actually matter.\nThat's predicate pushdown. Push the filter down to the earliest possible point in the pipeline. Less data processed. Less memory used. Faster result.\n### **Projection Pruning**\nSame idea, but for columns instead of rows.\nOur CSV has eight columns. But our final result only needs `sales`, `quantity`, `region`, and `status`. Polars looks at the query plan, figures out which columns are actually needed to produce the final output, and only loads those. The rest are ignored entirely.\nIn Pandas, you load everything first and figure out what you need later. Polars figures out what it needs before loading anything.  \nThese two optimizations — predicate pushdown and projection pruning — are what a database query optimizer does. If you've ever written SQL and wondered why the database is fast even on massive tables, this is a big part of why.\nAnd that's the mental shift here. When you write a Polars lazy pipeline, you're not really writing a script anymore. You're writing a query. You're describing what you want, and Polars — like a database engine — figures out the most efficient way to get it.\nThat's a different way of thinking. And once it clicks, you start approaching data pipelines differently. Instead of asking \"what should I do next?\", you start asking \"what do I actually need at the end?\" and working backwards from there.\n## **Mental Model Shift #3 — Columnar Memory**\nThere's one more piece to why Polars is fast. And it lives at a level below your code.\nPandas stores data in a row-oriented format under the hood. Imagine a spreadsheet where each row is stored together in memory — all the values for order 1, then all the values for order 2, and so on. That works fine for looking up individual records. \nBut when you want to compute something across an entire column — like summing all revenue values — Pandas has to hop through memory, picking out the relevant value from each row one at a time.\nPolars uses a columnar memory format called Apache Arrow. Instead of storing rows together, it stores columns together. All the revenue values sit next to each other in memory. All the region values sit next to each other. When you need to compute something on a column, everything you need is already in one contiguous block of memory.\nWhy does that matter? Two reasons.\nFirst, modern CPUs are built to process contiguous blocks of memory extremely efficiently. When your data is laid out in columns, the CPU can tear through it using vectorized instructions — processing multiple values in a single operation. Row-oriented storage breaks that optimization.\nSecond, columnar storage means Polars only touches the columns it needs. If your DataFrame has 20 columns but your operation only needs 3, Polars works with those 3 columns in memory. Pandas loads the whole thing regardless.\nYou don't have to do anything to get this benefit. It's just how Polars is built.\nThink of it this way. Pandas is like a filing cabinet where each drawer contains everything about one customer — their name, their orders, their payment history, all together. \nPolars is like a filing cabinet where one drawer has all the names, another has all the orders, another has all the payment histories. If you need to analyze payment histories across all customers, Polars opens one drawer. Pandas opens every single one.\nThat's the columnar memory model. And combined with lazy evaluation and query optimization, it's why Polars can do in 0.20 seconds what takes Pandas 0.31 seconds — even after Pandas has been carefully optimized by hand.\n## **Where Pandas Still Wins**\nI want to be straight with you here. This article isn't a Pandas obituary.\nAfter going through this entire exercise, there are still situations where I'd reach for Pandas without hesitation.\nFor quick exploration and ad hoc analysis, Pandas is hard to beat. The syntax is familiar, the ecosystem is massive, and when you're just poking around a dataset trying to understand it, the performance difference doesn't matter. You're not running a pipeline — you're thinking out loud.\nFor small datasets, Polars' advantages largely disappear. The overhead of building a query plan only pays off when there's enough data to make optimization worthwhile. On a few thousand rows, just use Pandas.\nFor visualization and integrations, Pandas is deeply woven into the Python data ecosystem. Matplotlib, Seaborn, Scikit-learn, Statsmodels — they all speak Pandas natively. Polars is catching up, but Pandas is still the common language.\nAnd honestly, for teams and collaborators, familiarity matters. If everyone on your team knows Pandas and nobody knows Polars, introducing it has a real cost.\nI'm not replacing Pandas. I'm becoming more intentional about when I use it.\nSmall dataset, quick exploration, visualization, team familiarity — Pandas. Large dataset, repeated pipeline, production workflow, performance matters — Polars.\nBoth tools. Right situations.\n## **Conclusion**\nHere's what I came in expecting: a speed comparison. Run the same code in two libraries, show the numbers, done.\nHere's what I actually got: a different way of thinking about data.\nThe speed numbers are real — we went from a 61-second broken Pandas pipeline in my last article, to 0.31 seconds with optimized Pandas, to 0.20 seconds with Polars lazy evaluation. That's a journey worth documenting.\nBut the more lasting thing is what Polars quietly teaches you along the way. That filters should be applied as early as possible. That you should only load what you need. That describing what you want and letting an optimizer figure out the how is a legitimate — and powerful — way to write data pipelines.\nThose aren't just Polars ideas. They're good data engineering ideas. And I wouldn't have sat down to really understand them if a comment on one of my posts hadn't pushed me toward a tool I'd never used before.\nPandas didn't become worse through any of this. My expectations just got bigger.\nIf you've got a workflow that feels slower than it should — even after you've cleaned up the code — it might be worth asking whether the tool itself has a ceiling. Sometimes the next step isn't writing better code. It's writing the same code in something built differently.\nWhat workflows are you running that might be worth a rewrite?\n## Register Now to Continue Reading\n### Unlock Towards Data Science with a Free Account\nAll articles on Towards Data Science are available to registered users. Create a free account today to access this article and thousands more.\nRegister for freeSign in to your account\n* * *\n![](../images/body-542334df68a32cd56c4a.jpeg)\nWritten By\n## [Ibrahim Salami](https://towardsdatascience.com/author/ibrahim.salami/)\n[See all from Ibrahim Salami](https://towardsdatascience.com/author/ibrahim.salami/)\n[Data Science](https://towardsdatascience.com/tag/data-science/)[Pandas](https://towardsdatascience.com/tag/pandas/)[Polars](https://towardsdatascience.com/tag/polars/)[Programming](https://towardsdatascience.com/tag/programming/)[Python](https://towardsdatascience.com/tag/python/)\nShare This Article\n  * [](https://www.facebook.com/sharer/sharer.php?u=https%3A%2F%2Ftowardsdatascience.com%2Fi-rewrote-a-real-data-workflow-in-polars-pandas-didnt-stand-a-chance%2F&title=I%20Rewrote%20a%20Real%20Data%20Workflow%20in%20Polars.%20Pandas%20Didn%E2%80%99t%20Stand%20a%20Chance.)\n  * [](https://www.linkedin.com/shareArticle?mini=true&url=https%3A%2F%2Ftowardsdatascience.com%2Fi-rewrote-a-real-data-workflow-in-polars-pandas-didnt-stand-a-chance%2F&title=I%20Rewrote%20a%20Real%20Data%20Workflow%20in%20Polars.%20Pandas%20Didn%E2%80%99t%20Stand%20a%20Chance.)\n  * [](https://x.com/share?url=https%3A%2F%2Ftowardsdatascience.com%2Fi-rewrote-a-real-data-workflow-in-polars-pandas-didnt-stand-a-chance%2F&text=I%20Rewrote%20a%20Real%20Data%20Workflow%20in%20Polars.%20Pandas%20Didn%E2%80%99t%20Stand%20a%20Chance.)\n\n\nTowards Data Science is a community publication. Submit your insights to reach our global audience and earn through the TDS Author Payment Program.\n[Write for TDS](https://towardsdatascience.com/submissions/)\n## Related Articles\n  * [![](../images/001.jpg)](https://towardsdatascience.com/resources-to-begin-your-artificial-intelligence-and-machine-learning-journey-7767a7d30831/)\n## [Resources to Begin Your Data Science Journey Now](https://towardsdatascience.com/resources-to-begin-your-artificial-intelligence-and-machine-learning-journey-7767a7d30831/)\n[Artificial Intelligence](https://towardsdatascience.com/category/artificial-intelligence/)\nStart Your Data Science Journey Now\n[Pranjal Saxena](https://towardsdatascience.com/author/pranjalai/)\nOctober 14, 20203 min read\n  * [![](../images/002.jpg)](https://towardsdatascience.com/training-a-model-on-google-ai-platform-84ceff87b5f3/)\n## [Training a model on Google's AI Platform](https://towardsdatascience.com/training-a-model-on-google-ai-platform-84ceff87b5f3/)\n[Machine Learning](https://towardsdatascience.com/category/artificial-intelligence/machine-learning/)\nHow to train a model in Python using Google Cloud services\n[Matteo Felici](https://towardsdatascience.com/author/matteofelici87/)\nSeptember 2, 20207 min read\n  * [![](../images/003.png)](https://towardsdatascience.com/a-flexible-framework-for-entity-resolution-da970732884a/)\n## [A Flexible Framework for Entity Resolution](https://towardsdatascience.com/a-flexible-framework-for-entity-resolution-da970732884a/)\n[Artificial Intelligence](https://towardsdatascience.com/category/artificial-intelligence/)\nHoyoung Jang & Cheng Lin | TMLS2019\n[TDS Editors](https://towardsdatascience.com/author/towardsdatascience/)\nJune 24, 20201 min read\n  * [![](../images/004.png)](https://towardsdatascience.com/gradio-vs-streamlit-vs-dash-vs-flask-d3defb1209a2/)\n## [Gradio vs Streamlit vs Dash vs Flask](https://towardsdatascience.com/gradio-vs-streamlit-vs-dash-vs-flask-d3defb1209a2/)\n[Machine Learning](https://towardsdatascience.com/category/artificial-intelligence/machine-learning/)\nComparing several web UI tools for data science!\n[Terence Shin, MSc, MBA](https://towardsdatascience.com/author/terenceshin/)\nFebruary 23, 20215 min read\n  * [![](../images/005.jpg)](https://towardsdatascience.com/10-awesome-programming-projects-for-data-scientists-d2bf64f72ee4/)\n## [10 Awesome Programming Projects for Data Scientists](https://towardsdatascience.com/10-awesome-programming-projects-for-data-scientists-d2bf64f72ee4/)\n[Programming](https://towardsdatascience.com/category/programming/)\nOriginal ideas to help you improve your coding and analysis\n[Rory Spanton](https://towardsdatascience.com/author/roryspanton/)\nAugust 19, 20208 min read\n  * [![](../images/006.jpeg)](https://towardsdatascience.com/10-examples-to-master-python-tuples-6c606ed42b96/)\n## [10 Examples to Master Python Tuples](https://towardsdatascience.com/10-examples-to-master-python-tuples-6c606ed42b96/)\n[Artificial Intelligence](https://towardsdatascience.com/category/artificial-intelligence/)\nA comprehensive practical guide\n[Soner Yıldırım](https://towardsdatascience.com/author/sonery/)\nNovember 8, 20205 min read\n  * [![](../images/007.png)](https://towardsdatascience.com/comprehensive-guide-to-crafting-a-perfect-cv-in-data-science-dd6294aeb444/)\n## [Comprehensive Guide to Crafting a Perfect CV in Data Science](https://towardsdatascience.com/comprehensive-guide-to-crafting-a-perfect-cv-in-data-science-dd6294aeb444/)\n[Data Science](https://towardsdatascience.com/category/data-science/)\nImpress recruiters and land your dream job by creating a standout resume\n[Slava Efimov](https://towardsdatascience.com/author/slavahead/)\nOctober 22, 202419 min read\n  * [![](../images/008.png)](https://towardsdatascience.com/understanding-synthetic-control-methods-dd9a291885a1/)\n## [Understanding Synthetic Control Methods](https://towardsdatascience.com/understanding-synthetic-control-methods-dd9a291885a1/)\n[Data Science](https://towardsdatascience.com/category/data-science/)\nA detailed guide to one of the most popular causal inference techniques in the industry\n[Matteo Courthoud](https://towardsdatascience.com/author/matteo.courthoud/)\nJuly 30, 202215 min read\n  * [![](../images/009.png)](https://towardsdatascience.com/beyond-english-implementing-a-multilingual-rag-solution-12ccba0428b6/)\n## [Beyond English: Implementing a multilingual RAG solution](https://towardsdatascience.com/beyond-english-implementing-a-multilingual-rag-solution-12ccba0428b6/)\n[Artificial Intelligence](https://towardsdatascience.com/category/artificial-intelligence/)\nAn introduction to the do's and don'ts when implementing a non-english Retrieval Augmented Generation (RAG) system\n[Jesper Alkestrup](https://towardsdatascience.com/author/jalkestrup/)\nDecember 20, 202318 min read\n\n\n  * [YouTube](https://www.youtube.com/c/TowardsDataScience)\n  * [X](https://x.com/TDataScience)\n  * [LinkedIn](https://www.linkedin.com/company/towards-data-science/)\n  * [Threads](https://www.threads.net/@towardsdatascience)\n  * [Bluesky](https://bsky.app/profile/towardsdatascience.com)\n\n\n[](https://towardsdatascience.com/)\nYour home for data science and AI. The world's leading publication for data science, data analytics, data engineering, machine learning, and artificial intelligence professionals.\nSubscribe to Our Newsletter[Write For TDS](https://towardsdatascience.com/submissions/)•[About](https://towardsdatascience.com/about-towards-data-science-d691af11cc2f/)•[Advertise](https://contact.towardsdatascience.com/advertise-with-towards-data-science)•[Privacy Policy](https://towardsdatascience.com/privacy-policy/)•[Terms of Use](https://towardsdatascience.com/website-terms-of-use/)\n© Insight Media Group, LLC 2026•[The New Stack](https://thenewstack.io)•[roadmap.sh](https://roadmap.sh)•[Creator Network](https://insightmediagroup.io/creator-network)\n####  Recommended Articles \nClose\n  * [ ![](https://h030.towardsdatascience.com/rest/v2/contentStores/d7d3a4ab-7caf-4383-bbd2-fbf7fb4f1787/items/607639/image?etag=1781250125848&width=500&height=500) Javascript Fatigue: HTMX Is All You Need to Build ChatGPT — Part 1 ](https://towardsdatascience.com/javascript-fatigue-you-dont-need-js-to-build-chatgpt/ \"Javascript Fatigue: HTMX Is All You Need to Build ChatGPT — Part 1\")\n  * [ ![](https://h030.towardsdatascience.com/rest/v2/contentStores/d7d3a4ab-7caf-4383-bbd2-fbf7fb4f1787/items/607930/image?etag=1782124566054&width=500&height=500) The Subset Sum Problem Solved in Linear Time for Dense Enough Inputs ](https://towardsdatascience.com/subset-sum-problem-solved-in-linear-time-for-dense-enough-inputs/ \"The Subset Sum Problem Solved in Linear Time for Dense Enough Inputs\")\n  * [ ![](https://h030.towardsdatascience.com/rest/v2/contentStores/d7d3a4ab-7caf-4383-bbd2-fbf7fb4f1787/items/3660/image?etag=1780176246070&width=500&height=500) Does Your Company Have a Data Strategy? ](https://towardsdatascience.com/does-your-company-have-a-data-strategy-e8944dbec4ae/ \"Does Your Company Have a Data Strategy?\")\n  * [ ![](https://h030.towardsdatascience.com/rest/v2/contentStores/d7d3a4ab-7caf-4383-bbd2-fbf7fb4f1787/items/4970/image?etag=1780565225463&width=500&height=500) Productivity Tips, Data Career Insights, and Other Recent Must-Reads ](https://towardsdatascience.com/productivity-tips-data-career-insights-and-other-recent-must-reads-5c47eb7a2fe0/ \"Productivity Tips, Data Career Insights, and Other Recent Must-Reads\")\n\n\n",
  "metadata": {
    "title": "I Rewrote a Real Data Workflow in Polars. Pandas Didn’t Stand a Chance. | Towards Data Science",
    "description": "From 61 seconds to 0.20 seconds — and the mental model shift I didn't expect",
    "keywords": null,
    "author": "Ibrahim Salami",
    "og:locale": "en_US",
    "og:type": "article",
    "og:title": "I Rewrote a Real Data Workflow in Polars. Pandas Didn’t Stand a Chance.",
    "og:description": "From 61 seconds to 0.20 seconds — and the mental model shift I didn't expect",
    "og:url": "https://towardsdatascience.com/i-rewrote-a-real-data-workflow-in-polars-pandas-didnt-stand-a-chance/",
    "og:site_name": "Towards Data Science",
    "og:image": "https://assets.insightmediagroup.io/media/wp-content/uploads/2026/05/polars-speed.jpg",
    "og:image:width": "985",
    "og:image:height": "537",
    "og:image:type": "image/jpeg",
    "twitter:card": "summary_large_image",
    "twitter:site": "@TDataScience",
    "twitter:creator": "@TDataScience",
    "twitter:label1": "Written by",
    "twitter:data1": "Ibrahim Salami",
    "twitter:label2": "Est. reading time",
    "twitter:data2": "14 min read",
    "article:published_time": "2026-05-07T06:00:05.000Z",
    "article:modified_time": "2026-05-07T06:00:05.000Z",
    "article:author": "https://towardsdatascience.com/author/ibrahim.salami/"
  },
  "paywall": {
    "listed_paid": false,
    "detected": false,
    "marker": "",
    "public_only": false,
    "policy": "付费/会员内容只保留页面公开可见部分，不绕过付费墙"
  },
  "crawl": {
    "success": true,
    "status_code": 202,
    "error": ""
  },
  "code_blocks": [
    {
      "language": "txt",
      "file": "attachments/a36be007b304/code/block_000.txt",
      "chars": 778
    },
    {
      "language": "txt",
      "file": "attachments/a36be007b304/code/block_001.txt",
      "chars": 626
    },
    {
      "language": "txt",
      "file": "attachments/a36be007b304/code/block_002.txt",
      "chars": 29
    },
    {
      "language": "txt",
      "file": "attachments/a36be007b304/code/block_003.txt",
      "chars": 64
    },
    {
      "language": "txt",
      "file": "attachments/a36be007b304/code/block_004.txt",
      "chars": 7
    },
    {
      "language": "txt",
      "file": "attachments/a36be007b304/code/block_005.txt",
      "chars": 536
    },
    {
      "language": "txt",
      "file": "attachments/a36be007b304/code/block_006.txt",
      "chars": 35
    },
    {
      "language": "txt",
      "file": "attachments/a36be007b304/code/block_007.txt",
      "chars": 517
    },
    {
      "language": "txt",
      "file": "attachments/a36be007b304/code/block_008.txt",
      "chars": 34
    },
    {
      "language": "txt",
      "file": "attachments/a36be007b304/code/block_009.txt",
      "chars": 424
    },
    {
      "language": "txt",
      "file": "attachments/a36be007b304/code/block_010.txt",
      "chars": 284
    }
  ],
  "images": [
    {
      "status": "http_404",
      "url": "https://h030.towardsdatascience.com/rest/v2/contentStores/d7d3a4ab-7caf-4383-bbd2-fbf7fb4f1787/items/607639/image?etag=1781250125848&width=500&height=500",
      "src": "https://h030.towardsdatascience.com/rest/v2/contentStores/d7d3a4ab-7caf-4383-bbd2-fbf7fb4f1787/items/607639/image?etag=1781250125848&width=500&height=500",
      "alt": "",
      "downloaded": false,
      "discovery": "saved_markdown",
      "retried_at": "2026-10-20T17:46:45Z"
    },
    {
      "status": "http_404",
      "url": "https://h030.towardsdatascience.com/rest/v2/contentStores/d7d3a4ab-7caf-4383-bbd2-fbf7fb4f1787/items/607930/image?etag=1782124566054&width=500&height=500",
      "src": "https://h030.towardsdatascience.com/rest/v2/contentStores/d7d3a4ab-7caf-4383-bbd2-fbf7fb4f1787/items/607930/image?etag=1782124566054&width=500&height=500",
      "alt": "",
      "downloaded": false,
      "discovery": "saved_markdown",
      "retried_at": "2026-10-20T17:46:45Z"
    },
    {
      "status": "http_404",
      "url": "https://h030.towardsdatascience.com/rest/v2/contentStores/d7d3a4ab-7caf-4383-bbd2-fbf7fb4f1787/items/3660/image?etag=1780176246070&width=500&height=500",
      "src": "https://h030.towardsdatascience.com/rest/v2/contentStores/d7d3a4ab-7caf-4383-bbd2-fbf7fb4f1787/items/3660/image?etag=1780176246070&width=500&height=500",
      "alt": "",
      "downloaded": false,
      "discovery": "saved_markdown",
      "retried_at": "2026-10-20T17:46:45Z"
    },
    {
      "status": "http_404",
      "url": "https://h030.towardsdatascience.com/rest/v2/contentStores/d7d3a4ab-7caf-4383-bbd2-fbf7fb4f1787/items/4970/image?etag=1780565225463&width=500&height=500",
      "src": "https://h030.towardsdatascience.com/rest/v2/contentStores/d7d3a4ab-7caf-4383-bbd2-fbf7fb4f1787/items/4970/image?etag=1780565225463&width=500&height=500",
      "alt": "",
      "downloaded": false,
      "discovery": "saved_markdown",
      "retried_at": "2026-10-20T17:47:33Z"
    }
  ],
  "audio": [],
  "videos": [
    {
      "url": "https://www.youtube.com/c/TowardsDataScience",
      "kind": "channel_reference",
      "status": "reference_only"
    }
  ],
  "links": [
    {
      "type": "internal",
      "href": "https://towardsdatascience.com/"
    },
    {
      "type": "internal",
      "href": "https://towardsdatascience.com/latest/"
    },
    {
      "type": "internal",
      "href": "https://towardsdatascience.com/tag/editors-pick/"
    },
    {
      "type": "internal",
      "href": "https://towardsdatascience.com/tag/the-variable/"
    },
    {
      "type": "internal",
      "href": "https://towardsdatascience.com/shipai/"
    },
    {
      "type": "internal",
      "href": "https://towardsdatascience.com/submissions/"
    },
    {
      "type": "internal",
      "href": "https://towardsdatascience.com/category/data-science/"
    },
    {
      "type": "internal",
      "href": "https://towardsdatascience.com/author/ibrahim.salami/"
    },
    {
      "type": "internal",
      "href": "https://towardsdatascience.com/stop-writing-loops-in-pandas-do-this-instead/"
    },
    {
      "type": "internal",
      "href": "https://towardsdatascience.com/i-reduced-my-pandas-runtime-by-95-heres-what-i-was-doing-wrong/"
    },
    {
      "type": "internal",
      "href": "https://towardsdatascience.com/tag/data-science/"
    },
    {
      "type": "internal",
      "href": "https://towardsdatascience.com/tag/pandas/"
    },
    {
      "type": "internal",
      "href": "https://towardsdatascience.com/tag/polars/"
    },
    {
      "type": "internal",
      "href": "https://towardsdatascience.com/tag/programming/"
    },
    {
      "type": "internal",
      "href": "https://towardsdatascience.com/tag/python/"
    },
    {
      "type": "internal",
      "href": "https://towardsdatascience.com/resources-to-begin-your-artificial-intelligence-and-machine-learning-journey-7767a7d30831/"
    },
    {
      "type": "internal",
      "href": "https://towardsdatascience.com/category/artificial-intelligence/"
    },
    {
      "type": "internal",
      "href": "https://towardsdatascience.com/author/pranjalai/"
    },
    {
      "type": "internal",
      "href": "https://towardsdatascience.com/training-a-model-on-google-ai-platform-84ceff87b5f3/"
    },
    {
      "type": "internal",
      "href": "https://towardsdatascience.com/category/artificial-intelligence/machine-learning/"
    },
    {
      "type": "external",
      "href": "https://write.insightmediagroup.io"
    },
    {
      "type": "external",
      "href": "https://www.linkedin.com/company/towards-data-science/"
    },
    {
      "type": "external",
      "href": "https://x.com/TDataScience"
    },
    {
      "type": "external",
      "href": "https://roadmap.sh/ai-data-scientist"
    },
    {
      "type": "external",
      "href": "https://www.facebook.com/sharer/sharer.php?title=I+Rewrote+a+Real+Data+Workflow+in+Polars.+Pandas+Didn%E2%80%99t+Stand+a+Chance.&u=https%3A%2F%2Ftowardsdatascience.com%2Fi-rewrote-a-real-data-workflow-in-polars-pandas-didnt-stand-a-chance%2F"
    },
    {
      "type": "external",
      "href": "https://www.linkedin.com/shareArticle?mini=true&title=I+Rewrote+a+Real+Data+Workflow+in+Polars.+Pandas+Didn%E2%80%99t+Stand+a+Chance.&url=https%3A%2F%2Ftowardsdatascience.com%2Fi-rewrote-a-real-data-workflow-in-polars-pandas-didnt-stand-a-chance%2F"
    },
    {
      "type": "external",
      "href": "https://x.com/share?text=I+Rewrote+a+Real+Data+Workflow+in+Polars.+Pandas+Didn%E2%80%99t+Stand+a+Chance.&url=https%3A%2F%2Ftowardsdatascience.com%2Fi-rewrote-a-real-data-workflow-in-polars-pandas-didnt-stand-a-chance%2F"
    },
    {
      "type": "external",
      "href": "https://www.youtube.com/c/TowardsDataScience"
    },
    {
      "type": "external",
      "href": "https://www.threads.net/@towardsdatascience"
    },
    {
      "type": "external",
      "href": "https://bsky.app/profile/towardsdatascience.com"
    },
    {
      "type": "external",
      "href": "https://thenewstack.io"
    },
    {
      "type": "external",
      "href": "https://roadmap.sh"
    },
    {
      "type": "external",
      "href": "https://insightmediagroup.io/creator-network"
    }
  ],
  "repair_version": 2,
  "repaired_at": "2026-10-20T17:26:14Z",
  "source_url": "https://towardsdatascience.com/i-rewrote-a-real-data-workflow-in-polars-pandas-didnt-stand-a-chance/",
  "delivery_status": "unverified",
  "discovery_status": "http_403",
  "missing_reason": "源页面未重新核验:http_403；已按保留正文补采图片",
  "repair_error": "",
  "actual_video_files": [],
  "expected_saved_body_images": 4,
  "image_discovery": "saved_markdown",
  "source_body_markdown": "![Revisit consent button](https://cdn-cookieyes.com/assets/images/revisit.svg)\nWe value your privacy\nWe use cookies to enhance your browsing experience, serve personalised ads or content, and analyse our traffic. By clicking \"Accept All\", you consent to our use of cookies.\nCustomise Reject All Accept All\nCustomise Consent Preferences ![](https://cdn-cookieyes.com/assets/images/close.svg)\nWe use cookies to help you navigate efficiently and perform certain functions. You will find detailed information about all cookies under each consent category below.\nThe cookies that are categorised as \"Necessary\" are stored on your browser as they are essential for enabling the basic functionalities of the site. ... Show more\nNecessaryAlways Active\nNecessary cookies are required to enable the basic features of this site, such as providing secure log-in or adjusting your consent preferences. These cookies do not store any personally identifiable data.\n  * Cookie\nBCTempID\n  * Duration\n10 minutes\n  * Description\nNo description available.\n\n\n  * Cookie\n__cf_bm\n  * Duration\n1 hour\n  * Description\nThis cookie, set by Cloudflare, is used to support Cloudflare Bot Management. \n\n\n  * Cookie\nAWSALBCORS\n  * Duration\n7 days\n  * Description\nAmazon Web Services set this cookie for load balancing.\n\n\n  * Cookie\n_cfuvid\n  * Duration\nsession\n  * Description\nCloudflare sets this cookie to track users across sessions to optimize user experience by maintaining session consistency and providing personalized services\n\n\n  * Cookie\nli_gc\n  * Duration\n6 months\n  * Description\nLinkedin set this cookie for storing visitor's consent regarding using cookies for non-essential purposes.\n\n\n  * Cookie\n__hssrc\n  * Duration\nsession\n  * Description\nThis cookie is set by Hubspot whenever it changes the session cookie. The __hssrc cookie set to 1 indicates that the user has restarted the browser, and if the cookie does not exist, it is assumed to be a new session.\n\n\n  * Cookie\n__hssc\n  * Duration\n1 hour\n  * Description\nHubSpot sets this cookie to keep track of sessions and to determine if HubSpot should increment the session number and timestamps in the __hstc cookie.\n\n\n  * Cookie\nwpEmojiSettingsSupports\n  * Duration\nsession\n  * Description\nWordPress sets this cookie when a user interacts with emojis on a WordPress site. It helps determine if the user's browser can display emojis properly.\n\n\n  * Cookie\nBCSessionID\n  * Duration\n1 year 1 month 4 days\n  * Description\nBlueconic sets this cookie as a unique identifier for the BlueConic profile.\n\n\n  * Cookie\n_octo\n  * Duration\n1 year\n  * Description\nNo description available.\n\n\n  * Cookie\nlogged_in\n  * Duration\n1 year\n  * Description\nNo description available.\n\n\n  * Cookie\n__Secure-YEC\n  * Duration\npast\n  * Description\nYouTube sets this cookie to stores the user's video player preferences using embedded YouTube video\n\n\n  * Cookie\n__eoi\n  * Duration\n6 months\n  * Description\nDescription is currently not available.\n\n\n  * Cookie\nAWSALBTGCORS\n  * Duration\n7 days\n  * Description\nNo description available.\n\n\n  * Cookie\nlogin-status-p\n  * Duration\npast\n  * Description\nDescription is currently not available.\n\n\n  * Cookie\nAWSALBTG\n  * Duration\n7 days\n  * Description\nNo description available.\n\n\n  * Cookie\ncsrf_token\n  * Duration\nsession\n  * Description\nNo description available.\n\n\n  * Cookie\ntoken_v2\n  * Duration\n1 day\n  * Description\nDescription is currently not available.\n\n\n  * Cookie\nD\n  * Duration\n1 year\n  * Description\nDescription is currently not available.\n\n\n  * Cookie\nPHPSESSID\n  * Duration\nsession\n  * Description\nThis cookie is native to PHP applications. The cookie stores and identifies a user's unique session ID to manage user sessions on the website. The cookie is a session cookie and will be deleted when all the browser windows are closed.\n\n\n  * Cookie\nVISITOR_PRIVACY_METADATA\n  * Duration\n6 months\n  * Description\nYouTube sets this cookie to store the user's cookie consent state for the current domain. \n\n\n  * Cookie\ncookietest\n  * Duration\nsession\n  * Description\nThe cookietest cookie is typically used to determine whether the user's browser accepts cookies, essential for website functionality and user experience.\n\n\n  * Cookie\n__Host-airtable-session\n  * Duration\n1 year\n  * Description\nThis cookie is used to enable us to integrate the services of Airtable.\n\n\n  * Cookie\n__Host-airtable-session.sig\n  * Duration\n1 year\n  * Description\nThis cookie is used to enable us to integrate the services of Airtable.\n\n\n  * Cookie\nm\n  * Duration\n1 year 1 month 4 days\n  * Description\nStripe sets this cookie for fraud prevention purposes. It identifies the device used to access the website, allowing the website to be formatted accordingly.\n\n\n  * Cookie\nBIGipServer*\n  * Duration\nsession\n  * Description\nMarketo sets this cookie to collect information about the user's online activity and build a profile about their interests to provide advertisements relevant to the user. \n\n\n  * Cookie\n__cfruid\n  * Duration\nsession\n  * Description\nCloudflare sets this cookie to identify trusted web traffic.\n\n\n  * Cookie\n_GRECAPTCHA\n  * Duration\n6 months\n  * Description\nGoogle Recaptcha service sets this cookie to identify bots to protect the website against malicious spam attacks.\n\n\n  * Cookie\n__Secure-YNID\n  * Duration\n6 months\n  * Description\nGoogle cookie used to protect user security and prevent fraud, especially during the login process.\n\n\n  * Cookie\ncookieyes-consent\n  * Duration\n1 year\n  * Description\nCookieYes sets this cookie to remember users' consent preferences so that their preferences are respected on subsequent visits to this site. It does not collect or store any personal information about the site visitors.\n\n\nFunctional\nFunctional cookies help perform certain functionalities like sharing the content of the website on social media platforms, collecting feedback, and other third-party features.\n  * Cookie\nlidc\n  * Duration\n1 day\n  * Description\nLinkedIn sets the lidc cookie to facilitate data center selection.\n\n\n  * Cookie\nbrw\n  * Duration\n1 year\n  * Description\nNo description available.\n\n\n  * Cookie\nbrwConsent\n  * Duration\n5 minutes\n  * Description\nDescription is currently not available.\n\n\n  * Cookie\nWMF-Uniq\n  * Duration\n1 year\n  * Description\nDescription is currently not available.\n\n\n  * Cookie\nloom_anon_comment\n  * Duration\n1 year\n  * Description\nNo description available.\n\n\n  * Cookie\nloom_referral_video\n  * Duration\nsession\n  * Description\nDescription is currently not available.\n\n\n  * Cookie\nVISITOR_INFO1_LIVE\n  * Duration\n6 months\n  * Description\nA cookie set by YouTube to measure bandwidth that determines whether the user gets the new or old player interface.\n\n\n  * Cookie\nyt-remote-connected-devices\n  * Duration\nNever Expires\n  * Description\nYouTube sets this cookie to store the user's video preferences using embedded YouTube videos.\n\n\n  * Cookie\nytidb::LAST_RESULT_ENTRY_KEY\n  * Duration\nNever Expires\n  * Description\nThe cookie ytidb::LAST_RESULT_ENTRY_KEY is used by YouTube to store the last search result entry that was clicked by the user. This information is used to improve the user experience by providing more relevant search results in the future.\n\n\n  * Cookie\nyt-remote-device-id\n  * Duration\nNever Expires\n  * Description\nYouTube sets this cookie to store the user's video preferences using embedded YouTube videos.\n\n\n  * Cookie\nyt-remote-session-name\n  * Duration\nsession\n  * Description\nThe yt-remote-session-name cookie is used by YouTube to store the user's video player preferences using embedded YouTube video.\n\n\n  * Cookie\nyt-remote-fast-check-period\n  * Duration\nsession\n  * Description\nThe yt-remote-fast-check-period cookie is used by YouTube to store the user's video player preferences for embedded YouTube videos.\n\n\n  * Cookie\nyt-remote-session-app\n  * Duration\nsession\n  * Description\nThe yt-remote-session-app cookie is used by YouTube to store user preferences and information about the interface of the embedded YouTube video player.\n\n\n  * Cookie\nyt-remote-cast-available\n  * Duration\nsession\n  * Description\nThe yt-remote-cast-available cookie is used to store the user's preferences regarding whether casting is available on their YouTube video player.\n\n\n  * Cookie\nyt-remote-cast-installed\n  * Duration\nsession\n  * Description\nThe yt-remote-cast-installed cookie is used to store the user's video player preferences using embedded YouTube video.\n\n\n  * Cookie\ncp_session\n  * Duration\n3 months\n  * Description\nCodepen sets this cookie for Help systems found in the website.\n\n\n  * Cookie\nloid\n  * Duration\n1 year 1 month 4 days\n  * Description\nThis cookie is set by the Reddit. The cookie enables the sharing of content from the website onto the social media platform.\n\n\nAnalytics\nAnalytical cookies are used to understand how visitors interact with the website. These cookies help provide information on metrics such as the number of visitors, bounce rate, traffic source, etc.\n  * Cookie\n__hstc\n  * Duration\n6 months\n  * Description\nHubspot set this main cookie for tracking visitors. It contains the domain, initial timestamp (first visit), last timestamp (last visit), current timestamp (this visit), and session number (increments for each subsequent session).\n\n\n  * Cookie\nhubspotutk\n  * Duration\n6 months\n  * Description\nHubSpot sets this cookie to keep track of the visitors to the website. This cookie is passed to HubSpot on form submission and used when deduplicating contacts.\n\n\n  * Cookie\n_ga\n  * Duration\n1 year 1 month 4 days\n  * Description\nGoogle Analytics sets this cookie to calculate visitor, session and campaign data and track site usage for the site's analytics report. The cookie stores information anonymously and assigns a randomly generated number to recognise unique visitors.\n\n\n  * Cookie\n_ga_*\n  * Duration\n1 year 1 month 4 days\n  * Description\nGoogle Analytics sets this cookie to store and count page views.\n\n\n  * Cookie\n__Host-psifi.analyticsTrace\n  * Duration\n6 hours\n  * Description\nDescription is currently not available.\n\n\n  * Cookie\n__Host-psifi.analyticsTraceV2\n  * Duration\n6 hours\n  * Description\nDescription is currently not available.\n\n\n  * Cookie\n_gh_sess\n  * Duration\nsession\n  * Description\nGitHub sets this cookie for temporary application and framework state between pages like what step the user is on in a multiple step form.\n\n\n  * Cookie\nYSC\n  * Duration\nsession\n  * Description\nYSC cookie is set by Youtube and is used to track the views of embedded videos on Youtube pages.\n\n\n  * Cookie\najs_anonymous_id\n  * Duration\n1 year\n  * Description\nThis cookie is set by Segment to count the number of people who visit a certain site by tracking if they have visited before.\n\n\n  * Cookie\nvuid\n  * Duration\n1 year 1 month 4 days\n  * Description\nVimeo installs this cookie to collect tracking information by setting a unique ID to embed videos on the website. \n\n\nPerformance\nPerformance cookies are used to understand and analyse the key performance indexes of the website which helps in delivering a better user experience for the visitors.\n  * Cookie\nAWSALB\n  * Duration\n7 days\n  * Description\nAWSALB is an application load balancer cookie set by Amazon Web Services to map the session to the target.\n\n\n  * Cookie\nacq\n  * Duration\npast\n  * Description\nDescription is currently not available.\n\n\n  * Cookie\nacq.sig\n  * Duration\npast\n  * Description\nDescription is currently not available.\n\n\n  * Cookie\nptc\n  * Duration\n2 years\n  * Description\nNo description available.\n\n\nAdvertisement\nAdvertisement cookies are used to provide visitors with customised advertisements based on the pages you visited previously and to analyse the effectiveness of the ad campaigns.\n  * Cookie\nmuc_ads\n  * Duration\n1 year 1 month 4 days\n  * Description\nTwitter sets this cookie to collect user behaviour and interaction data to optimize the website.\n\n\n  * Cookie\nguest_id_marketing\n  * Duration\n1 year 1 month 4 days\n  * Description\nTwitter sets this cookie to identify and track the website visitor.\n\n\n  * Cookie\nguest_id_ads\n  * Duration\n1 year 1 month 4 days\n  * Description\nTwitter sets this cookie to identify and track the website visitor.\n\n\n  * Cookie\npersonalization_id\n  * Duration\n1 year 1 month 4 days\n  * Description\nTwitter sets this cookie to integrate and share features for social media and also store information about how the user uses the website, for tracking and targeting.\n\n\n  * Cookie\nguest_id\n  * Duration\n1 year 1 month 4 days\n  * Description\nTwitter sets this cookie to identify and track the website visitor. It registers if a user is signed in to the Twitter platform and collects information about ad preferences.\n\n\n  * Cookie\nbcookie\n  * Duration\n1 year\n  * Description\nLinkedIn sets this cookie from LinkedIn share buttons and ad tags to recognize browser IDs.\n\n\n  * Cookie\n__Secure-ROLLOUT_TOKEN\n  * Duration\n6 months\n  * Description\nYouTube sets this cookie to manage feature rollout and experimentation. It helps Google control which new features or interface changes are shown to users as part of testing and staged rollouts, ensuring consistent experience for a given user during an experiment.\n\n\n  * Cookie\nyt.innertube::nextId\n  * Duration\nNever Expires\n  * Description\nYouTube sets this cookie to register a unique ID to store data on what videos from YouTube the user has seen.\n\n\n  * Cookie\nyt.innertube::requests\n  * Duration\nNever Expires\n  * Description\nYouTube sets this cookie to register a unique ID to store data on what videos from YouTube the user has seen.\n\n\n  * Cookie\nsession_tracker\n  * Duration\nsession\n  * Description\nThis cookie is set by the Reddit. This cookie is used to identify trusted web traffic. It also helps in adverstising on the website.\n\n\n  * Cookie\nedgebucket\n  * Duration\nsession\n  * Description\nReddit sets this cookie to save the information about a log-on Reddit user, for the purpose of advertisement recommendations and updating the content.\n\n\n  * Cookie\ndid\n  * Duration\n1 year\n  * Description\nArbor sets this cookie to show targeted ads to site visitors.This cookie expires after 2 months or 1 year.\n\n\nUncategorised\nOther uncategorised cookies are those that are being analysed and have not been classified into a category as yet.\nNo cookies to display.\nReject All Save My Preferences Accept All\nToggle Search[](https://towardsdatascience.com/)Toggle Mobile Navigation\n[](https://towardsdatascience.com/)\nPublish AI, ML & data-science insights to a global community of data professionals.\nSign in[Submit an Article](https://write.insightmediagroup.io)\n[Latest](https://towardsdatascience.com/latest/)[Editor's Picks](https://towardsdatascience.com/tag/editors-pick/)[Newsletter](https://towardsdatascience.com/tag/the-variable/)[ShipAI](https://towardsdatascience.com/shipai/)\n* * *\n[Write For TDS](https://towardsdatascience.com/submissions/)\n[LinkedIn](https://www.linkedin.com/company/towards-data-science/)[X](https://x.com/TDataScience)Toggle Search\n[Data Science](https://towardsdatascience.com/category/data-science/)\n# I Rewrote a Real Data Workflow in Polars. Pandas Didn’t Stand a Chance.\nFrom 61 seconds to 0.20 seconds — and the mental model shift I didn't expect\n[Ibrahim Salami](https://towardsdatascience.com/author/ibrahim.salami/)\nMay 7, 202614 min read\n![](https://assets.insightmediagroup.io/media/wp-content/uploads/2026/05/polars-speed.jpg)\nCreated with Gemini AI\nI'll be honest — I wasn't actively looking for Polars.\nI've been on a bit of a Pandas optimization journey lately. First, I wrote about why you should [stop writing loops in Pandas](https://towardsdatascience.com/stop-writing-loops-in-pandas-do-this-instead/) and think in columns instead.\nThen I went deeper to profiling real workflows, fixing vectorization mistakes, and ended up cutting a [61-second pipeline down to 0.33 seconds](https://towardsdatascience.com/i-reduced-my-pandas-runtime-by-95-heres-what-i-was-doing-wrong/) using nothing but better Pandas and NumPy. That one surprised even me.\nSo I was in a good place with Pandas. I felt like I finally understood how to use it properly.\nThen someone dropped a comment on one of my posts. Something along the lines of: _\"Have you tried Polars? It's built for exactly this kind of thing.\"_\nI'd seen the name floating around in the data community. There was buzz around it — something about speed, about a completely different way of thinking about data pipelines. But I'd never actually touched it.\nThat comment was enough to push me over the edge.\nSo I did what I always do. I got curious, I installed it, and I rewrote the exact same workflow from my last article, the one I'd already optimized in Pandas, in a tool I'd never used before.\nWhat I found surprised me. Not just the speed numbers, but what Polars quietly teaches you about how data pipelines actually work.\nLearn this step by step with the interactive [AI and Data Scientist](https://roadmap.sh/ai-data-scientist) roadmap.\n## **Isn't Pandas Enough?**\nFair question.\nIn my last article, I took a slow Pandas pipeline and optimized it down to 0.33 seconds. Vectorized operations, correct data types, no unnecessary copies. The results were honestly better than I expected.\nSo why are we even talking about Polars?\nHere's the thing. Everything I did in that article was me doing the optimization manually. I had to know which operations were slow, why they were slow, and how to fix them. Polars does a lot of that thinking for you automatically, before it even runs your code.\nOn top of that, Polars is built on a completely different foundation than Pandas. It uses all your CPU cores by default. It manages memory differently. And it introduces a way of writing data pipelines that, once it clicks, changes how you think about the whole process.\nOptimized Pandas is impressive. But it still has a ceiling. This article is about what's on the other side of it.\n## **The Workflow**\nTo keep things consistent and useful for anyone who followed along with my last article. I'm using the same synthetic e-commerce dataset. One million rows. Nothing exotic. Just the kind of data you'd realistically encounter in the wild.\nIf you want to generate it yourself, here's the setup code:\npython\n\n```\nimport pandas as pd\nimport numpy as np\nimport time\n\nnp.random.seed(42)\n\nn = 1_000_000\n\nregions = ['north', 'south', 'east', 'west']\ncategories = ['electronics', 'clothing', 'furniture', 'food', 'sports']\nstatuses = ['completed', 'returned', 'pending', 'cancelled']\n\ndf = pd.DataFrame({\n    'order_id': np.arange(1000, 1000 + n),\n    'order_date': pd.date_range(start='2022-01-01', periods=n, freq='1min'),\n    'region': np.random.choice(regions, size=n),\n    'category': np.random.choice(categories, size=n),\n    'sales': np.random.randint(100, 10000, size=n),\n    'quantity': np.random.randint(1, 20, size=n),\n    'discount': np.round(np.random.uniform(0.0, 0.5, size=n), 2),\n    'status': np.random.choice(statuses, size=n),\n})\n\ndf.to_csv('large_sales_data.csv', index=False)\n```\n\nThe pipeline we're running on it is straightforward. The kind of thing that shows up in real workflows all the time:\n  * Fix data types upfront\n  * Calculate net revenue per order\n  * Flag high-value orders\n  * Aggregate total net revenue by region\n\n\nSimple. Familiar. And already optimized in Pandas from the last article, which makes it the perfect benchmark for Polars.\n## **The Pandas Version**\nI'm not going to show you the naive Pandas code here. I already did that in my last article — the version with three `.apply()` calls that took 61 seconds on this same dataset. If you haven't read that one, it's worth a look.\nWhat I'm showing here is the optimized version. The best Pandas can do on this pipeline.\npython\n\n```\nimport pandas as pd\nimport numpy as np\nimport time\n\ndf = pd.read_csv('large_sales_data.csv')\n\nstart = time.time()\n\n# Fix data types upfront\ndf['region'] = df['region'].astype('category')\ndf['category'] = df['category'].astype('category')\ndf['status'] = df['status'].astype('category')\n\n# Vectorized revenue calculation\ndf['net_revenue'] = df['sales'] * df['quantity'] * (1 - 0.075)\n\n# Vectorized flagging\ndf['order_flag'] = np.where(df['net_revenue'] > 50000, 'high', 'low')\n\n# Aggregation\nresult = df.groupby('region')['net_revenue'].sum()\n\nend = time.time()\nprint(f\"Pandas runtime: {end - start:.2f} seconds\")\nprint(result)\n```\n\nThis is clean Pandas. Vectorized operations, correct data types, no unnecessary intermediate columns. Everything I learned from going down that rabbit hole.\nAnd the result?\ntext\n\n```\nPandas runtime: 0.31 seconds\n```\n\nThat's already really good. Genuinely impressive for a million rows.  \nBut here's the question I kept sitting with after seeing that number: what does it look like when the tool is doing the optimization for you, instead of you doing it manually?\nThat's what we're about to find out.\n## **Installing Polars and First Impressions**\nGetting started was straightforward. If you're on Google Colab like me, one line is all you need:\npython\n\n```\n!pip install polars \nimport polars as pl \nprint(pl.__version__)\n```\n\ntext\n\n```\n1.35.2\n```\n\nDone. No environment headaches, no dependency conflicts. That alone was a good start.\nBut then I opened the Polars documentation and immediately noticed something. The syntax looked familiar enough — DataFrames, columns, filtering — but the way you're supposed to _think_ about operations felt different. \nIn Pandas, you work with your data step by step. You do something, store the result, do something else. In Polars, you describe what you want as a single expression, and Polars figures out how to execute it.\nI didn't fully understand that yet. But I was about to.\nThe other thing that caught my eye immediately was this concept of **lazy** vs **eager** execution. In Pandas, every line of code runs the moment you write it. Polars gives you a choice: you can run eagerly like Pandas, or you can build up a full query plan first and let Polars optimize it before executing anything.\nI didn't know what that meant in practice yet. But I kept seeing it everywhere in the docs. So I decided the best way to understand it was to just rewrite my pipeline and see what happened.\n## **The Eager Version**\npython\n\n```\nimport polars as pl\nimport time\n\nstart = time.time()\n\nresult = (\n    pl.read_csv('large_sales_data.csv')\n    .with_columns([\n        (pl.col('sales') * pl.col('quantity') * (1 - 0.075)).alias('net_revenue')\n    ])\n    .with_columns([\n        pl.when(pl.col('net_revenue') > 50000)\n        .then(pl.lit('high'))\n        .otherwise(pl.lit('low'))\n        .alias('order_flag')\n    ])\n    .group_by('region')\n    .agg(pl.col('net_revenue').sum())\n)\n\nend = time.time()\nprint(f\"Polars Eager runtime: {end - start:.2f} seconds\")\nprint(result)\n```\n\ntext\n\n```\nPolars Eager runtime: 0.83 seconds\n```\n\nThe first thing I noticed was the method chaining. In Pandas, I was making separate assignments, doing one thing, storing the result, doing the next thing.\nHere, everything flows as a single expression from start to finish. You're describing the entire pipeline at once.\nLet me break down the syntax quickly since some of it will look unfamiliar:\n  * `pl.read_csv()` — reads the CSV, same concept as `pd.read_csv()`. Nothing surprising.\n  * `.with_columns([...])` — this is how Polars adds or transforms columns. The equivalent of `df['new_col'] = ...` in Pandas. You can compute multiple columns in a single call.\n  * `pl.col('sales')` — this is how you reference a column in Polars. Instead of `df['sales']`, you write `pl.col('sales')`. You're not grabbing the data directly — you're describing an operation on that column. That distinction matters more than it sounds.\n  * `.alias('net_revenue')` — just naming the result. Like saying \"call this new column net_revenue.\"\n  * `pl.when(...).then(...).otherwise(...)` — Polars' version of `np.where()`. Reads almost like plain English: when this condition is true, return this value, otherwise return that one.\n  * `.group_by('region').agg(...)` — same concept as Pandas `.groupby()`. Group the data, then define your aggregation. Different syntax, same idea.\n\n\nNow here's the thing. That eager version ran in 0.83 seconds. That's actually slower than our optimized Pandas at 0.31 seconds. If I'd stopped here, I'd have written Polars off entirely.\nBut I kept reading the docs. And I found something called lazy evaluation.\n## **The Lazy Version**\npython\n\n```\nstart = time.time()\n\nresult = (\n    pl.scan_csv('large_sales_data.csv')\n    .with_columns([\n        (pl.col('sales') * pl.col('quantity') * (1 - 0.075)).alias('net_revenue')\n    ])\n    .with_columns([\n        pl.when(pl.col('net_revenue') > 50000)\n        .then(pl.lit('high'))\n        .otherwise(pl.lit('low'))\n        .alias('order_flag')\n    ])\n    .group_by('region')\n    .agg(pl.col('net_revenue').sum())\n    .collect()\n)\n\nend = time.time()\nprint(f\"Polars Lazy runtime: {end - start:.2f} seconds\")\nprint(result)\n```\n\ntext\n\n```\nPolars Lazy runtime: 0.20 seconds\n```\n\nSpot the two differences from the eager version. `pl.read_csv()` became `pl.scan_csv()` — this tells Polars not to load anything yet, just start building a query plan. And `.collect()` was added at the end — that's where you tell Polars \"okay, now execute everything.\"\nTwo changes. That's it.\nAnd just like that, 0.83 seconds became 0.20 seconds.\nPolars lazy is 35% faster than our already optimized Pandas pipeline. Without me doing any manual optimization. Without me profiling anything. Without me knowing in advance which operations were bottlenecks.\nPolars figured that out on its own.\nThat's when I started paying attention.\n## **Mental Model Shift #1 — Lazy vs Eager Execution**\nThis is the one that changed how I think about data pipelines.  \nIn Pandas, every line of code executes the moment you write it. You assign a column — it runs. You filter a DataFrame — it runs. You group and aggregate — it runs. \nEach operation is independent, immediate, and unaware of what comes before or after it.\nThat's eager execution. It's intuitive. It feels natural because it matches how we think about writing code step by step.\nPolars gives you a choice.\nWhen you use `pl.scan_csv()` instead of `pl.read_csv()`, you're telling Polars: _don't execute anything yet._ Just start building a plan. Every `.with_columns()`, every `.filter()`, every `.group_by()` you chain after that isn't running — it's being recorded. You're describing what you want, not triggering it.\nThen when you call `.collect()` at the end, Polars takes that entire plan, looks at it as a whole, optimizes it, and then executes it in one efficient pass.\nThink of it this way:\n  * **Pandas** is like following a recipe step by step. Chop the onions. Put them in the pan. Add the garlic. Each instruction happens immediately, in order, one at a time.\n  * **Polars lazy** is like a chef who reads the entire recipe first, figures out the most efficient way to prepare everything, and then executes it in the optimal order. Same result. Less wasted effort.\n\n\nThat optimization step is the key. Before Polars runs a single line of your pipeline it asks: what columns do we actually need? What rows can we eliminate early? What operations can be parallelized? What work can be skipped entirely?\nYou can actually see the query plan Polars builds before it executes.\nRun this:\npython\n\n```\nlazy_query = (\n    pl.scan_csv('large_sales_data.csv')\n    .with_columns([\n        (pl.col('sales') * pl.col('quantity') * (1 - 0.075)).alias('net_revenue')\n    ])\n    .with_columns([\n        pl.when(pl.col('net_revenue') > 50000)\n        .then(pl.lit('high'))\n        .otherwise(pl.lit('low'))\n        .alias('order_flag')\n    ])\n    .group_by('region')\n    .agg(pl.col('net_revenue').sum())\n)\n\nprint(lazy_query.explain())\n```\n\nThat `.explain()` call shows you exactly what Polars is planning to do before it does it. It's the optimizer's thinking made visible.  \nThis is something Pandas simply doesn't have. \nIn Pandas, the optimization is your responsibility. You have to know which operations are expensive, profile your code, and restructure it manually — which is exactly what I did in my last article. In Polars lazy mode, the optimizer handles that for you.\nThat's not a small difference. That's a fundamentally different relationship between you and your data pipeline.\n## **Mental Model Shift #2 — Query Optimization**\nOnce I understood lazy evaluation, I started wondering — okay, but what exactly is Polars optimizing? What is it actually doing differently under the hood?\nTurns out there are two big ones worth knowing about. And once you understand them, you start seeing why Polars is faster not just on this pipeline, but on almost any non-trivial workflow.\n### **Predicate Pushdown**\nLet's say you add a filter to our pipeline — you only want completed orders:\npython\n\n```\nresult = (\n    pl.scan_csv('large_sales_data.csv')\n    .with_columns([\n        (pl.col('sales') * pl.col('quantity') * (1 - 0.075)).alias('net_revenue')\n    ])\n    .filter(pl.col('status') == 'completed')\n    .group_by('region')\n    .agg(pl.col('net_revenue').sum())\n    .collect()\n)\n```\n\nIn eager mode — Pandas or Polars eager — this is what happens: load all one million rows, compute net revenue for all of them, then filter down to completed orders. You did expensive work on rows you were going to throw away anyway.\nPolars lazy does something smarter. It looks at the entire query plan and says: there's a filter here. Let me apply that filter as early as possible — ideally before loading data, or right after. That way I'm only doing the expensive computations on the rows that actually matter.\nThat's predicate pushdown. Push the filter down to the earliest possible point in the pipeline. Less data processed. Less memory used. Faster result.\n### **Projection Pruning**\nSame idea, but for columns instead of rows.\nOur CSV has eight columns. But our final result only needs `sales`, `quantity`, `region`, and `status`. Polars looks at the query plan, figures out which columns are actually needed to produce the final output, and only loads those. The rest are ignored entirely.\nIn Pandas, you load everything first and figure out what you need later. Polars figures out what it needs before loading anything.  \nThese two optimizations — predicate pushdown and projection pruning — are what a database query optimizer does. If you've ever written SQL and wondered why the database is fast even on massive tables, this is a big part of why.\nAnd that's the mental shift here. When you write a Polars lazy pipeline, you're not really writing a script anymore. You're writing a query. You're describing what you want, and Polars — like a database engine — figures out the most efficient way to get it.\nThat's a different way of thinking. And once it clicks, you start approaching data pipelines differently. Instead of asking \"what should I do next?\", you start asking \"what do I actually need at the end?\" and working backwards from there.\n## **Mental Model Shift #3 — Columnar Memory**\nThere's one more piece to why Polars is fast. And it lives at a level below your code.\nPandas stores data in a row-oriented format under the hood. Imagine a spreadsheet where each row is stored together in memory — all the values for order 1, then all the values for order 2, and so on. That works fine for looking up individual records. \nBut when you want to compute something across an entire column — like summing all revenue values — Pandas has to hop through memory, picking out the relevant value from each row one at a time.\nPolars uses a columnar memory format called Apache Arrow. Instead of storing rows together, it stores columns together. All the revenue values sit next to each other in memory. All the region values sit next to each other. When you need to compute something on a column, everything you need is already in one contiguous block of memory.\nWhy does that matter? Two reasons.\nFirst, modern CPUs are built to process contiguous blocks of memory extremely efficiently. When your data is laid out in columns, the CPU can tear through it using vectorized instructions — processing multiple values in a single operation. Row-oriented storage breaks that optimization.\nSecond, columnar storage means Polars only touches the columns it needs. If your DataFrame has 20 columns but your operation only needs 3, Polars works with those 3 columns in memory. Pandas loads the whole thing regardless.\nYou don't have to do anything to get this benefit. It's just how Polars is built.\nThink of it this way. Pandas is like a filing cabinet where each drawer contains everything about one customer — their name, their orders, their payment history, all together. \nPolars is like a filing cabinet where one drawer has all the names, another has all the orders, another has all the payment histories. If you need to analyze payment histories across all customers, Polars opens one drawer. Pandas opens every single one.\nThat's the columnar memory model. And combined with lazy evaluation and query optimization, it's why Polars can do in 0.20 seconds what takes Pandas 0.31 seconds — even after Pandas has been carefully optimized by hand.\n## **Where Pandas Still Wins**\nI want to be straight with you here. This article isn't a Pandas obituary.\nAfter going through this entire exercise, there are still situations where I'd reach for Pandas without hesitation.\nFor quick exploration and ad hoc analysis, Pandas is hard to beat. The syntax is familiar, the ecosystem is massive, and when you're just poking around a dataset trying to understand it, the performance difference doesn't matter. You're not running a pipeline — you're thinking out loud.\nFor small datasets, Polars' advantages largely disappear. The overhead of building a query plan only pays off when there's enough data to make optimization worthwhile. On a few thousand rows, just use Pandas.\nFor visualization and integrations, Pandas is deeply woven into the Python data ecosystem. Matplotlib, Seaborn, Scikit-learn, Statsmodels — they all speak Pandas natively. Polars is catching up, but Pandas is still the common language.\nAnd honestly, for teams and collaborators, familiarity matters. If everyone on your team knows Pandas and nobody knows Polars, introducing it has a real cost.\nI'm not replacing Pandas. I'm becoming more intentional about when I use it.\nSmall dataset, quick exploration, visualization, team familiarity — Pandas. Large dataset, repeated pipeline, production workflow, performance matters — Polars.\nBoth tools. Right situations.\n## **Conclusion**\nHere's what I came in expecting: a speed comparison. Run the same code in two libraries, show the numbers, done.\nHere's what I actually got: a different way of thinking about data.\nThe speed numbers are real — we went from a 61-second broken Pandas pipeline in my last article, to 0.31 seconds with optimized Pandas, to 0.20 seconds with Polars lazy evaluation. That's a journey worth documenting.\nBut the more lasting thing is what Polars quietly teaches you along the way. That filters should be applied as early as possible. That you should only load what you need. That describing what you want and letting an optimizer figure out the how is a legitimate — and powerful — way to write data pipelines.\nThose aren't just Polars ideas. They're good data engineering ideas. And I wouldn't have sat down to really understand them if a comment on one of my posts hadn't pushed me toward a tool I'd never used before.\nPandas didn't become worse through any of this. My expectations just got bigger.\nIf you've got a workflow that feels slower than it should — even after you've cleaned up the code — it might be worth asking whether the tool itself has a ceiling. Sometimes the next step isn't writing better code. It's writing the same code in something built differently.\nWhat workflows are you running that might be worth a rewrite?\n## Register Now to Continue Reading\n### Unlock Towards Data Science with a Free Account\nAll articles on Towards Data Science are available to registered users. Create a free account today to access this article and thousands more.\nRegister for freeSign in to your account\n* * *\n![](https://assets.insightmediagroup.io/media/1787657709013_9ddcph.jpeg)\nWritten By\n## [Ibrahim Salami](https://towardsdatascience.com/author/ibrahim.salami/)\n[See all from Ibrahim Salami](https://towardsdatascience.com/author/ibrahim.salami/)\n[Data Science](https://towardsdatascience.com/tag/data-science/)[Pandas](https://towardsdatascience.com/tag/pandas/)[Polars](https://towardsdatascience.com/tag/polars/)[Programming](https://towardsdatascience.com/tag/programming/)[Python](https://towardsdatascience.com/tag/python/)\nShare This Article\n  * [](https://www.facebook.com/sharer/sharer.php?u=https%3A%2F%2Ftowardsdatascience.com%2Fi-rewrote-a-real-data-workflow-in-polars-pandas-didnt-stand-a-chance%2F&title=I%20Rewrote%20a%20Real%20Data%20Workflow%20in%20Polars.%20Pandas%20Didn%E2%80%99t%20Stand%20a%20Chance.)\n  * [](https://www.linkedin.com/shareArticle?mini=true&url=https%3A%2F%2Ftowardsdatascience.com%2Fi-rewrote-a-real-data-workflow-in-polars-pandas-didnt-stand-a-chance%2F&title=I%20Rewrote%20a%20Real%20Data%20Workflow%20in%20Polars.%20Pandas%20Didn%E2%80%99t%20Stand%20a%20Chance.)\n  * [](https://x.com/share?url=https%3A%2F%2Ftowardsdatascience.com%2Fi-rewrote-a-real-data-workflow-in-polars-pandas-didnt-stand-a-chance%2F&text=I%20Rewrote%20a%20Real%20Data%20Workflow%20in%20Polars.%20Pandas%20Didn%E2%80%99t%20Stand%20a%20Chance.)\n\n\nTowards Data Science is a community publication. Submit your insights to reach our global audience and earn through the TDS Author Payment Program.\n[Write for TDS](https://towardsdatascience.com/submissions/)\n## Related Articles\n  * [![](https://assets.insightmediagroup.io/media/wp-content/uploads/2020/10/0Rl8L-zhGyFwOd2Mg-scaled.jpg)](https://towardsdatascience.com/resources-to-begin-your-artificial-intelligence-and-machine-learning-journey-7767a7d30831/)\n## [Resources to Begin Your Data Science Journey Now](https://towardsdatascience.com/resources-to-begin-your-artificial-intelligence-and-machine-learning-journey-7767a7d30831/)\n[Artificial Intelligence](https://towardsdatascience.com/category/artificial-intelligence/)\nStart Your Data Science Journey Now\n[Pranjal Saxena](https://towardsdatascience.com/author/pranjalai/)\nOctober 14, 20203 min read\n  * [![](https://assets.insightmediagroup.io/media/wp-content/uploads/2020/09/016gqBBWlebCBfLvH-scaled.jpg)](https://towardsdatascience.com/training-a-model-on-google-ai-platform-84ceff87b5f3/)\n## [Training a model on Google's AI Platform](https://towardsdatascience.com/training-a-model-on-google-ai-platform-84ceff87b5f3/)\n[Machine Learning](https://towardsdatascience.com/category/artificial-intelligence/machine-learning/)\nHow to train a model in Python using Google Cloud services\n[Matteo Felici](https://towardsdatascience.com/author/matteofelici87/)\nSeptember 2, 20207 min read\n  * [![](https://assets.insightmediagroup.io/media/wp-content/uploads/2020/06/1pHMX2KDL5SZW0L-Y14xEKg.png)](https://towardsdatascience.com/a-flexible-framework-for-entity-resolution-da970732884a/)\n## [A Flexible Framework for Entity Resolution](https://towardsdatascience.com/a-flexible-framework-for-entity-resolution-da970732884a/)\n[Artificial Intelligence](https://towardsdatascience.com/category/artificial-intelligence/)\nHoyoung Jang & Cheng Lin | TMLS2019\n[TDS Editors](https://towardsdatascience.com/author/towardsdatascience/)\nJune 24, 20201 min read\n  * [![](https://assets.insightmediagroup.io/media/wp-content/uploads/2021/02/1W5EUsJxwpGNxKXeQkHmHNA.png)](https://towardsdatascience.com/gradio-vs-streamlit-vs-dash-vs-flask-d3defb1209a2/)\n## [Gradio vs Streamlit vs Dash vs Flask](https://towardsdatascience.com/gradio-vs-streamlit-vs-dash-vs-flask-d3defb1209a2/)\n[Machine Learning](https://towardsdatascience.com/category/artificial-intelligence/machine-learning/)\nComparing several web UI tools for data science!\n[Terence Shin, MSc, MBA](https://towardsdatascience.com/author/terenceshin/)\nFebruary 23, 20215 min read\n  * [![](https://assets.insightmediagroup.io/media/wp-content/uploads/2020/08/022vFnZtZqhS4Apa8-scaled.jpg)](https://towardsdatascience.com/10-awesome-programming-projects-for-data-scientists-d2bf64f72ee4/)\n## [10 Awesome Programming Projects for Data Scientists](https://towardsdatascience.com/10-awesome-programming-projects-for-data-scientists-d2bf64f72ee4/)\n[Programming](https://towardsdatascience.com/category/programming/)\nOriginal ideas to help you improve your coding and analysis\n[Rory Spanton](https://towardsdatascience.com/author/roryspanton/)\nAugust 19, 20208 min read\n  * [![](https://assets.insightmediagroup.io/media/wp-content/uploads/2021/03/1oKyfMtQvDoBwJXdwCmSMXw-scaled.jpeg)](https://towardsdatascience.com/10-examples-to-master-python-tuples-6c606ed42b96/)\n## [10 Examples to Master Python Tuples](https://towardsdatascience.com/10-examples-to-master-python-tuples-6c606ed42b96/)\n[Artificial Intelligence](https://towardsdatascience.com/category/artificial-intelligence/)\nA comprehensive practical guide\n[Soner Yıldırım](https://towardsdatascience.com/author/sonery/)\nNovember 8, 20205 min read\n  * [![](https://assets.insightmediagroup.io/media/wp-content/uploads/2024/10/1JJKxox1Z0mJfDezwU5l-KQ.png)](https://towardsdatascience.com/comprehensive-guide-to-crafting-a-perfect-cv-in-data-science-dd6294aeb444/)\n## [Comprehensive Guide to Crafting a Perfect CV in Data Science](https://towardsdatascience.com/comprehensive-guide-to-crafting-a-perfect-cv-in-data-science-dd6294aeb444/)\n[Data Science](https://towardsdatascience.com/category/data-science/)\nImpress recruiters and land your dream job by creating a standout resume\n[Slava Efimov](https://towardsdatascience.com/author/slavahead/)\nOctober 22, 202419 min read\n  * [![](https://assets.insightmediagroup.io/media/wp-content/uploads/2022/07/1x6jvyqigFKfXvcj00g4RTg.png)](https://towardsdatascience.com/understanding-synthetic-control-methods-dd9a291885a1/)\n## [Understanding Synthetic Control Methods](https://towardsdatascience.com/understanding-synthetic-control-methods-dd9a291885a1/)\n[Data Science](https://towardsdatascience.com/category/data-science/)\nA detailed guide to one of the most popular causal inference techniques in the industry\n[Matteo Courthoud](https://towardsdatascience.com/author/matteo.courthoud/)\nJuly 30, 202215 min read\n  * [![](https://assets.insightmediagroup.io/media/wp-content/uploads/2023/12/1XjgVhm9YT0lXZYH_GNDQuA.png)](https://towardsdatascience.com/beyond-english-implementing-a-multilingual-rag-solution-12ccba0428b6/)\n## [Beyond English: Implementing a multilingual RAG solution](https://towardsdatascience.com/beyond-english-implementing-a-multilingual-rag-solution-12ccba0428b6/)\n[Artificial Intelligence](https://towardsdatascience.com/category/artificial-intelligence/)\nAn introduction to the do's and don'ts when implementing a non-english Retrieval Augmented Generation (RAG) system\n[Jesper Alkestrup](https://towardsdatascience.com/author/jalkestrup/)\nDecember 20, 202318 min read\n\n\n  * [YouTube](https://www.youtube.com/c/TowardsDataScience)\n  * [X](https://x.com/TDataScience)\n  * [LinkedIn](https://www.linkedin.com/company/towards-data-science/)\n  * [Threads](https://www.threads.net/@towardsdatascience)\n  * [Bluesky](https://bsky.app/profile/towardsdatascience.com)\n\n\n[](https://towardsdatascience.com/)\nYour home for data science and AI. The world's leading publication for data science, data analytics, data engineering, machine learning, and artificial intelligence professionals.\nSubscribe to Our Newsletter[Write For TDS](https://towardsdatascience.com/submissions/)•[About](https://towardsdatascience.com/about-towards-data-science-d691af11cc2f/)•[Advertise](https://contact.towardsdatascience.com/advertise-with-towards-data-science)•[Privacy Policy](https://towardsdatascience.com/privacy-policy/)•[Terms of Use](https://towardsdatascience.com/website-terms-of-use/)\n© Insight Media Group, LLC 2026•[The New Stack](https://thenewstack.io)•[roadmap.sh](https://roadmap.sh)•[Creator Network](https://insightmediagroup.io/creator-network)\n####  Recommended Articles \nClose\n  * [ ![](https://h030.towardsdatascience.com/rest/v2/contentStores/d7d3a4ab-7caf-4383-bbd2-fbf7fb4f1787/items/607639/image?etag=1781250125848&width=500&height=500) Javascript Fatigue: HTMX Is All You Need to Build ChatGPT — Part 1 ](https://towardsdatascience.com/javascript-fatigue-you-dont-need-js-to-build-chatgpt/ \"Javascript Fatigue: HTMX Is All You Need to Build ChatGPT — Part 1\")\n  * [ ![](https://h030.towardsdatascience.com/rest/v2/contentStores/d7d3a4ab-7caf-4383-bbd2-fbf7fb4f1787/items/607930/image?etag=1782124566054&width=500&height=500) The Subset Sum Problem Solved in Linear Time for Dense Enough Inputs ](https://towardsdatascience.com/subset-sum-problem-solved-in-linear-time-for-dense-enough-inputs/ \"The Subset Sum Problem Solved in Linear Time for Dense Enough Inputs\")\n  * [ ![](https://h030.towardsdatascience.com/rest/v2/contentStores/d7d3a4ab-7caf-4383-bbd2-fbf7fb4f1787/items/3660/image?etag=1780176246070&width=500&height=500) Does Your Company Have a Data Strategy? ](https://towardsdatascience.com/does-your-company-have-a-data-strategy-e8944dbec4ae/ \"Does Your Company Have a Data Strategy?\")\n  * [ ![](https://h030.towardsdatascience.com/rest/v2/contentStores/d7d3a4ab-7caf-4383-bbd2-fbf7fb4f1787/items/4970/image?etag=1780565225463&width=500&height=500) Productivity Tips, Data Career Insights, and Other Recent Must-Reads ](https://towardsdatascience.com/productivity-tips-data-career-insights-and-other-recent-must-reads-5c47eb7a2fe0/ \"Productivity Tips, Data Career Insights, and Other Recent Must-Reads\")\n\n\n",
  "body_base_path": "attachments/a36be007b304/pages/",
  "body_markdown_path": "attachments/a36be007b304/pages/archived-body.md",
  "local_html": "attachments/a36be007b304/pages/archived-body.html",
  "body_source": "prior_capture"
}