Skip to content Skip to sidebar Skip to footer

How To Optimize This Pandas Code To Run Faster

I have this code to create a swarmplot from data from a DataFrame: df = pd.DataFrame({'Refined__Some_ID':some_id_list, 'Refined_Age':age_list,

Solution 1:

Do you really mean a swarmplot with several hundred thousand points? Besides it's gonna take forever, it's nonsense. Try with the first 1000 and see what kind of mess you get. Then use a boxplot or a violinplot instead. Try to understand your tools before using them.

From the docstring:

[...] it does not scale as well to large numbers of observations (both in terms of the ability to show all the points and in terms of the computation needed to arrange them).

Post a Comment for "How To Optimize This Pandas Code To Run Faster"