Category : dask

I’m using the Dask map_blocks function with the run_simulation function which receives input from Dask Array chunks. See the example below. Unfortunately, I get an error about distributed.protocol.core – CRITICAL – Failed to Serialize. This appears to be from the object created from solver.solve(model, t_eval, inputs={‘Current function [A]’: d}). This is a solution object from ..

Read more

I have a Dask function that attempts to add a column to an existing Dask dataframe, this works fine: df = pd.DataFrame({ ‘height’: [6.21, 5.12, 5.85, 5.78, 5.98], ‘weight’: [150, 126, 133, 164, 203] }) df_dask = dd.from_pandas(df, npartitions=2) s = """ obj.weight + 100 """ df_dask[‘new_weight’] = df_dask.apply(lambda obj: eval(s), meta=dict axis=1) Now, I ..

Read more

I have case where I am creating pandas Timestamp object from string ‘2021-10-19 09:13:25.091’. simple pd.to_datetime(‘2021-10-19 09:13:25.091’) returns TIMESTAMP object. As moving to DASK tried doing same as follow with: https://docs.dask.org/en/latest/generated/dask.dataframe.to_datetime.html import dask.dataframe as dd logtimestamp = ‘2021-10-19 09:13:25.091’ print(dd.to_datetime(logtimestamp)) But it raise exception: dask.dataframe.to_datetime does not support non-indexable arguments. However as per document: https://docs.dask.org/en/latest/generated/dask.dataframe.to_datetime.html ..

Read more

I have a for-loop that runs a simulation solver on an array containing 100 items. On my local machine this takes about 2.5 seconds to solve. The example code is below. import numpy as np import pybamm import time def run_simulation(dis, sim, t_eval): sim.solve(t_eval, inputs={‘Current function [A]’: dis}) return sim.solution def main(): tic = time.perf_counter() ..

Read more

I have the following 3 dataframes that I am trying to combine: Leads Id Name Title 0 00Q6F00000zEkMXUA0 V.B Swamy Managing Director 1 00Q6F00000zEkMXUA1 Vandana Suri Founder & CEO Campaigns Id Name NumberOfLeads 0 7016F000001Oo2xQAC Testing Campaign A 1 1 7016F000001bHoHQAU Testing Campaign B 2 Campaign Members CampaignId LeadId 0 7016F000001bHoHQAU 00Q6F00000zEkMXUA0 1 7016F000001bHoHQAU 00Q6F00000zEkMXUA1 ..

Read more