Close Menu
    Trending
    • People are using AI to ‘sit’ with them while they trip on psychedelics
    • Reinforcement Learning in the Age of Modern AI | by @pramodchandrayan | Jul, 2025
    • How This Man Grew His Beverage Side Hustle From $1k a Month to 7 Figures
    • Finding the right tool for the job: Visual Search for 1 Million+ Products | by Elliot Ford | Kingfisher-Technology | Jul, 2025
    • How Smart Entrepreneurs Turn Mid-Year Tax Reviews Into Long-Term Financial Wins
    • Become a Better Data Scientist with These Prompt Engineering Tips and Tricks
    • Meanwhile in Europe: How We Learned to Stop Worrying and Love the AI Angst | by Andreas Maier | Jul, 2025
    • Transform Complexity into Opportunity with Digital Engineering
    AIBS News
    • Home
    • Artificial Intelligence
    • Machine Learning
    • AI Technology
    • Data Science
    • More
      • Technology
      • Business
    AIBS News
    Home»Artificial Intelligence»Pandas Can’t Handle This: How ArcticDB Powers Massive Datasets
    Artificial Intelligence

    Pandas Can’t Handle This: How ArcticDB Powers Massive Datasets

    Team_AIBS NewsBy Team_AIBS NewsFebruary 13, 2025No Comments15 Mins Read
    Share Facebook Twitter Pinterest LinkedIn Tumblr Reddit Telegram Email
    Share
    Facebook Twitter LinkedIn Pinterest Email

    Python has grown to dominate knowledge science, and its package deal Pandas has turn out to be the go-to instrument for knowledge evaluation. It’s nice for tabular knowledge and helps knowledge information of as much as 1GB if in case you have a big RAM. Inside these dimension limits, it’s also good with time-series knowledge as a result of it comes with some in-built assist.

    That being stated, relating to bigger datasets, Pandas alone may not be sufficient. And fashionable datasets are rising exponentially, whether or not they’re from finance, local weather science, or different fields.

    Which means, as of at this time, Pandas is a superb instrument for smaller tasks or exploratory evaluation. It’s not nice, nevertheless, once you’re dealing with greater duties or wish to scale into manufacturing quick. Workarounds exist — Dask, Spark, Polars, and chunking are a few of them — however they arrive with further complexity and bottlenecks.

    I confronted this drawback just lately. I used to be trying to see whether or not there are correlations between climate knowledge from the previous 10 years, and inventory costs of vitality firms. The rationale right here is there could be sensitivities between international temperatures and the inventory value evolution of fossil fuel- and renewable vitality firms. If one discovered such sensitivities, that may be a powerful sign for Huge Vitality CEOs to start out chopping their emissions in their very own self-interest.

    I obtained the inventory value knowledge fairly simply via Yahoo! Finance’s API. I used 16 shares and ETFs — seven fossil gas firms, six renewables firms, and three vitality ETFs — and their day by day shut over ten years between 2013 to 2023. That resulted in about 45,000 datapoints. That’s a bit of cake for Pandas.

    International climate knowledge was a completely completely different image. To begin with, it took me hours to obtain it via the Copernicus API. The API itself is superb; the issue is simply that there’s a lot knowledge. I wished worldwide day by day temperature knowledge between 2013 and 2023. The little drawback with that is that, with climate stations at 721 factors of geographical latitude and 1440 factors of geographical longitude, you’re downloading and later processing near 3.8 billion datapoints.

    That’s quite a lot of datapoints. Price 185 GB of area on my onerous drive.

    To judge this a lot knowledge I attempted chunking, however this overloaded my state-of-the-art pc. Iterating via that dataset one step at a time labored, nevertheless it took me half a day to course of it each time I wished to run a easy evaluation.

    The excellent news is that I’m fairly well-connected within the monetary companies business. I’d heard about ArcticDB some time again however had by no means given it a shot up to now. It’s a database which was developed at Man Group, a hedge fund the place a number of contacts of mine work at.

    So I gave ArcticDB a shot for this mission — and I’m not wanting again. I’m not abandoning Pandas, however for datasets within the billions I’ll select ArcticDB over Pandas any day.

    I ought to make clear two issues at this level: First, though I do know individuals at ArcticDB / Man Group, I’m not formally affiliated with them. I did this mission independently and selected to share the outcomes with you. Second, ArcticDB will not be totally open-source. It’s free for particular person customers inside affordable limits however has paid tiers for energy customers and companies. I used the free model, which will get you fairly far—and nicely past the scope of this mission truly.

    With that out of the best way, I’ll now present you find out how to arrange ArcticDB and what its primary utilization is. I’ll then go into my mission and the way I used ArcticDB on this case. You’ll additionally get to see some thrilling outcomes on the correlations I discovered between vitality shares and worldwide temperatures. I’ll observe with a efficiency comparability of ArcticDB and Pandas. Lastly, I’ll present precisely once you’ll be higher off utilizing ArcticDB, and when you’ll be able to safely use Pandas with out worrying about bottlenecks.

    ArcticDB For Novices

    At this level, you may need been questioning why I’ve been evaluating an information manipulation instrument — Pandas — with a full-blown database. The reality is that ArcticDB is a little bit of each: It shops knowledge conveniently, nevertheless it additionally helps manipulating knowledge. Some highly effective perks of it embrace quick queries, versioning, and higher reminiscence administration.

    Set up and Setup

    For Linux- and Home windows customers, getting ArcticDB is so simple as getting some other Python package deal:

    pip set up arcticdb  # or conda set up -c conda-forge arcticdb

    For Mac customers, issues are a little bit extra sophisticated. ArcticDB doesn’t assist Apple chips at the moment. Listed here are two workarounds (I’m on a Mac, and after testing I selected the primary):

    1. Run ArcticDB inside a Docker container.
    2. Use Rosetta 2 to emulate an x86 atmosphere.

    The second workaround works, however the efficiency is slower. It due to this fact wipes out a number of the good points of utilizing ArcticDB within the first place. Nonetheless, it’s a legitimate possibility if you happen to can’t or don’t wish to use Docker.

    To arrange ArcticDB, you have to create an area occasion within the following style:

    import arcticdb as adb
    library = adb.Arctic("lmdb://./arcticdb")  # Native storage
    library.create_library("climate_finance")

    ArcticDB helps a number of storage backends like AWS S3, Mongo DB, and LMDB. This makes it very simple to scale into manufacturing with out having to consider Data Engineering.

    Primary Utilization

    If you understand how to make use of Pandas, ArcticDB received’t be onerous for you. Right here’s the way you’d learn in a Pandas dataframe:

    import pandas as pd
    
    df = pd.DataFrame({"Date": ["2024-01-01", "2024-01-02"], "XOM": [100, 102]})
    df["Date"] = pd.to_datetime(df["Date"])  # Guarantee Date column is in datetime format
    
    climate_finance_lib = library["climate_finance"]
    climate_finance_lib.write("energy_stock_prices", df)

    To retrieve knowledge from ArcticDB, you’d proceed within the following style:

    df_stocks = climate_finance_lib.learn("energy_stock_prices").knowledge
    print(df_stocks.head())  # Confirm the saved knowledge

    One of many coolest options about ArcticDB is that it supplies versioning assist. If you’re updating your knowledge incessantly and solely wish to retrieve the newest model, that is the way you’d do it:

    latest_data = climate_finance_lib.learn("energy_stock_prices", as_of=0).knowledge

    And in order for you a particular model, you do that:

    versioned_data = climate_finance_lib.learn("energy_stock_prices", as_of=-3).knowledge

    Typically talking, the versioning works as follows: Very similar to in Numpy, the index 0 (following as_of= within the snippets above) refers back to the first model, -1 is the newest, and -3 is 2 variations earlier than that.

    Subsequent Steps

    After you have a grip round find out how to deal with your knowledge, you’ll be able to analyse your dataset as you at all times have completed. Even whereas utilizing ArcticDB, chunking could be a good option to scale back reminiscence utilization. When you scale to manufacturing, its native integration with AWS S3 and different storage methods might be your buddy.

    Vitality Shares Versus International Temperatures

    Constructing my research round vitality shares and their potential dependence on international temperatures was pretty simple. First, I used ArcticDB to retrieve the inventory returns knowledge and temperature knowledge. This was the script I used for acquiring the information:

    import arcticdb as adb
    import pandas as pd
    
    # Arrange ArcticDB
    library = adb.Arctic("lmdb://./arcticdb")  # Native storage
    library.create_library("climate_finance")
    
    # Load inventory knowledge
    df_stocks = pd.read_csv("energy_stock_prices.csv", index_col=0, parse_dates=True)
    
    # Retailer in ArcticDB
    climate_finance_lib = library["climate_finance"]
    climate_finance_lib.write("energy_stock_prices", df_stocks)
    
    # Load local weather knowledge and retailer (assuming NetCDF processing)
    import xarray as xr
    ds = xr.open_dataset("climate_data.nc")
    df_climate = ds.to_dataframe().reset_index()
    climate_finance_lib.write("climate_temperature", df_climate)

    A fast observe concerning the knowledge licenses: It’s permitted to make use of all this knowledge for business use. The Copernicus license permits this for the climate knowledge; the yfinance license permits this for the inventory knowledge. (The latter is a community-maintained mission that makes use of Yahoo Finance knowledge however will not be formally a part of Yahoo. Which means, ought to Yahoo sooner or later change its stance on yfinance—proper now it tolerates it—I’ll have to search out one other option to legally get this knowledge.)

    The above code does the heavy lifting round billions of datapoints inside just a few traces. If, like me, you’ve been battling knowledge engineering challenges up to now, I might not be stunned if you happen to really feel a little bit baffled by this.

    I then calculated the annual temperature anomaly. I did this by first computing the imply temperature throughout all grid factors within the dataset. I then subtracted this from the precise temperature every day to find out the deviation from the anticipated norm.

    This strategy is uncommon as a result of one would normally calculate the day by day imply temperature over 30 years of information to be able to assist seize uncommon temperature fluctuations relative to historic developments. However since I solely had 10 years of information available, I feared that this might muddy the outcomes to the purpose the place they’d be statistically laughable; therefore this strategy. (I’ll observe up with 30 years of information — and the assistance of ArcticDB — in due time!)

    Moreover, for the rolling correlations, I used a 30-day shifting window to calculate the correlation between inventory returns and my considerably particular temperature anomalies, making certain that short-term developments and fluctuations have been accounted for whereas smoothing out noise within the knowledge.

    As anticipated and to be seen under, we get two bumps — one for summer time and one for winter. (As talked about above, one might additionally calculate the day by day anomaly, however this normally requires a minimum of 30 years’ value of temperature knowledge — higher to do in manufacturing.)

    International temperature anomaly between 2013 and 2023. Picture by creator

    I then calculated the rolling correlation between varied inventory tickers and the worldwide common temperature. I did this by computing the Pearson correlation coefficient between the day by day returns of every inventory ticker and the corresponding day by day temperature anomaly over the rolling window. This technique captures how the connection evolves over time, revealing durations of heightened or diminished correlation.A number of this may be seen under.

    On the entire, one can see that the correlation modifications typically. Nonetheless, one may also see that there are extra pronounced peaks within the correlation for the featured fossil gas firms (XOM, SHEL, EOG) and vitality ETFs (XOP). There’s vital correlation with temperatures for renewables firms as nicely (ORSTED.CO, ENPH), nevertheless it stays inside stricter limits.

    Correlation of chosen shares with international temperature anomaly, 2013 to 2023. Picture by creator

    Correlation of chosen shares with international temperature anomaly, 2013 to 2023. Picture by creator

    This graph is moderately busy, so I made a decision to take the typical correlation with temperature for a number of shares. Primarily which means that I used the typical over time of the day by day correlations. The outcomes are moderately attention-grabbing: All fossil gas shares have a unfavorable correlation with the worldwide temperature anomaly (all the pieces from XOM to EOG under).

    Which means when the anomalies improve (i.e., there’s extra excessive warmth or chilly) the fossil inventory costs lower. The impact is important however weak, which means that international common temperature anomalies alone may not be the first drivers of inventory value actions. Nonetheless, it’s an attention-grabbing statement.

    Most renewables shares (from NEE to ENPH) have constructive correlations with the temperature anomaly. That is considerably anticipated; if temperatures get excessive, traders may begin considering extra about renewable vitality.

    Vitality ETFs (XLE, IXC, XOP) are additionally negatively correlated with temperature anomalies. This isn’t shocking as a result of these ETFs typically include a considerable amount of fossil gas firms.

    Common correlation of chosen shares with temperature anomaly, 2013–2023. Picture by creator

    Common correlation of chosen shares with temperature anomaly, 2013–2023. Picture by creator

    All these results are vital however small. To take this evaluation to the following stage, I’ll:

    1. Check the regional climate affect on chosen shares. For instance, chilly snaps in Texas may need outsized results on fossil gas shares. (Fortunately, retrieving such knowledge subsets is a appeal with ArcticDB!)
    2. Use extra climate variables: Other than temperatures, I anticipate wind speeds (and due to this fact storms) and precipitation (droughts and flooding) to have an effect on fossil and renewables shares in distinct methods.
    3. Utilizing AI-driven fashions: Easy correlation can say quite a bit, however nonlinear dependencies are higher discovered with Bayesian networks, random forests, or deep studying strategies.

    These insights might be revealed on this weblog after they’re prepared. Hopefully they’ll encourage the one or different Huge Vitality CEO to reshape their sustainability technique!

    ArcticDB Versus Pandas: Efficiency Checks

    For the sake of this text, I went forward and painstakingly re-ran my codes simply in Pandas, in addition to in a chunked model.

    Now we have 4 operations pertaining to 10 years of stock- and of local weather knowledge. The desk under reveals how the performances evaluate with a primary Pandas setup, with some chunking, and with the easiest way I might provide you with utilizing ArcticDB. As you’ll be able to see, the setup with ArcticDB is definitely 5 occasions quicker, if no more.

    Pandas works like a appeal for a small dataset of 45k rows, however loading a dataset of three.8 billion rows right into a primary Pandas setup will not be even doable on my machine. Loading it via chunking additionally solely labored with extra workarounds, primarily going one step at a time. With ArcticDB, alternatively, this was simple.

    In my setup, ArcticDB sped the entire course of up by an order of magnitude. Loading a really giant dataset was not even doable with out ArcticDB, if main workarounds weren’t employed!

    Supply: Ari Joury / Wangari – GlobalCreated with Datawrapper

    When To Use ArcticDB

    Pandas is nice for comparatively small, exploratory analyses. Nonetheless, when efficiency, scalability, and fast knowledge retrieval turn out to be mission-critical, ArcticDB may be an incredible ally. Beneath are some instances during which ArcticDB is value a critical consideration.

    When Your Dataset is Too Massive For Pandas

    Pandas masses all the pieces into RAM. Even with a superb machine, which means that datasets above just a few GB are certain to crash. ArcticDB additionally works with very huge datasets spanning tens of millions of columns. Pandas typically fails at this.

    When You’re Working With Time-Collection Information

    Time-series queries are frequent in fields like finance, local weather science, or IoT. Pandas has some native assist for time-series knowledge, however ArcticDB options quicker time-based indexing and filtering. It additionally helps versioning, which is superb for retrieving historic snapshots with out having to reload a complete dataset. Even if you happen to’re utilizing Pandas for analytics, ArcticDB hurries up knowledge retrieval, which might make your workflows a lot smoother.

    When You Want a Manufacturing-Prepared Database

    When you scale to manufacturing, Pandas received’t reduce it anymore. You’ll want a database. As an alternative of considering lengthy and deep about the perfect database to make use of and coping with loads of knowledge engineering challenges, you should use ArcticDB as a result of:

    • It simply integrates with cloud storage, notably AWS S3 and Azure.
    • It really works as a centralized database even for giant groups. In distinction, Pandas is simply an in-memory instrument.
    • It permits for parallelized reads and writes.
    • It seamlessly enhances analytical libraries like NumPy, PyTorch, and Pandas for extra advanced queries.

    The Backside Line: Use Cool Instruments To Achieve Time

    With out ArcticDB, my research on climate knowledge and vitality shares wouldn’t have been doable. A minimum of not with out main complications round pace and reminiscence bottlenecks.

    I’ve been utilizing and loving Pandas for years, so this isn’t an announcement to take calmly. I nonetheless suppose that it’s nice for smaller tasks and exploratory knowledge evaluation. Nonetheless, if you happen to’re dealing with substantial datasets or if you wish to scale your mannequin into manufacturing, ArcticDB is your buddy.

    Consider ArcticDB as an ally to Pandas moderately than a substitute — it bridges the hole between interactive knowledge exploration and production-scale analytics. To me, ArcticDB is due to this fact much more than a database. It’s also a sophisticated knowledge manipulation instrument, and it automates all the information engineering backend so to deal with the actually thrilling stuff.

    One thrilling consequence to me is the clear distinction in how fossil and renewables shares reply to temperature anomalies. As these anomalies improve resulting from local weather change, fossil shares will undergo. Is that not one thing to inform Huge Vitality CEOs?

    To take this additional, I would deal with extra localized climate and transcend temperature. I’ll additionally transcend easy correlations and use extra superior strategies to tease out nonlinear relationships within the knowledge. (And sure, ArcticDB will doubtless assist me with that.)

    On the entire, if you happen to’re dealing with giant or huge datasets, plenty of time collection knowledge, have to model your knowledge, or wish to scale shortly into manufacturing, ArcticDB is your buddy. I’m wanting ahead to exploring this instrument in additional element as my case research progress!

    Initially revealed at https://wangari.substack.com.



    Source link
    Share. Facebook Twitter Pinterest LinkedIn Tumblr Email
    Previous Article20+ Applied AI Conferences in 2025 | by Maciej Dzieżyc | Data Science Collective | Feb, 2025
    Next Article JPMorgan Is Reportedly Laying Off Around 1,000 Workers
    Team_AIBS News
    • Website

    Related Posts

    Artificial Intelligence

    Become a Better Data Scientist with These Prompt Engineering Tips and Tricks

    July 1, 2025
    Artificial Intelligence

    Lessons Learned After 6.5 Years Of Machine Learning

    July 1, 2025
    Artificial Intelligence

    Prescriptive Modeling Makes Causal Bets – Whether You Know it or Not!

    June 30, 2025
    Add A Comment
    Leave A Reply Cancel Reply

    Top Posts

    People are using AI to ‘sit’ with them while they trip on psychedelics

    July 1, 2025

    I Tried Buying a Car Through Amazon: Here Are the Pros, Cons

    December 10, 2024

    Amazon and eBay to pay ‘fair share’ for e-waste recycling

    December 10, 2024

    Artificial Intelligence Concerns & Predictions For 2025

    December 10, 2024

    Barbara Corcoran: Entrepreneurs Must ‘Embrace Change’

    December 10, 2024
    Categories
    • AI Technology
    • Artificial Intelligence
    • Business
    • Data Science
    • Machine Learning
    • Technology
    Most Popular

    The best apps to find new books

    February 24, 2025

    It’s Time to Rewrite Your Company’s Values — Here’s How

    January 11, 2025

    Cuantización en IA y Ciencia de Datos | by JORGE SISLEMA | Mar, 2025

    March 6, 2025
    Our Picks

    People are using AI to ‘sit’ with them while they trip on psychedelics

    July 1, 2025

    Reinforcement Learning in the Age of Modern AI | by @pramodchandrayan | Jul, 2025

    July 1, 2025

    How This Man Grew His Beverage Side Hustle From $1k a Month to 7 Figures

    July 1, 2025
    Categories
    • AI Technology
    • Artificial Intelligence
    • Business
    • Data Science
    • Machine Learning
    • Technology
    • Privacy Policy
    • Disclaimer
    • Terms and Conditions
    • About us
    • Contact us
    Copyright © 2024 Aibsnews.comAll Rights Reserved.

    Type above and press Enter to search. Press Esc to cancel.