I want to put the following data into pandas for further analysis.
import numpy as np
import pandas as pd
from pandas import DataFrame
data = np.array([[[1, 1, 1, np.nan, 1], [np.nan, 1, 1, 1, 1]],
[[2, np.nan, 2, 2, 2], [2, np.nan, 2, 2, 2]],
[[3, 3, 3, np.nan, 3], [3, 3, 3, 3, np.nan]]])
pnda = pd.Series(data)
print pnda
But the following error occurs:
Exception: Data must be 1-dimensional
What is the good way of doing it? My further analysis is to filling the np.nan values by interpolation with cubic or polynomial method and output the result as numpy array.
DataFrameonly accepts 2-D arrays...