I'm trying to send a nested list to a dataframe like so:
import pandas as pd
import numpy as np
def save_data(data):
df = pd.DataFrame(data=[data], columns=['Send/Collect', 'Hospital', 'Courier', 'Kit', 'Manufacturer'])
save_data([["One", "Two","Three", "Four", "Five"],
["One", "Two","Three", "Four", "Five"],
["One", "Two","Three", "Four", "Five"]])
However this pulls the Assertion Error as follows:
AssertionError: 5 columns passed, passed data had 3 columns
As seen on Git and another question I tried making the data into a numpy array as suggested yet this now returns this slightly more confusing error:
ValueError: Must pass 2-d input
In the real code, the list changes size with a fixed column size and so I'm not sure how to fix this!