How to convert a NumPy array to PIL image applying matplotlib colormap

I have a simple problem, but I cannot find a good solution to it. I want to take a NumPy 2D array which represents a grayscale image, and convert it to an RGB PIL image while applying some of the matplotlib colormaps. I can get a reasonable PNG output by using the pyplot.figure.figimage command: dpi … Read more

Take multiple lists into dataframe

How do I take multiple lists and put them as different columns in a python dataframe? I tried this solution but had some trouble. Attempt 1: Have three lists, and zip them together and use that res = zip(lst1,lst2,lst3) Yields just one column Attempt 2: percentile_list = pd.DataFrame({‘lst1Tite’ : [lst1], ‘lst2Tite’ : [lst2], ‘lst3Tite’ : … Read more