How to change pandas data type?
Is there a pandas function to type convert form 'pandas.core.series.Series' to 'pandas.core.frame.Pandas' ?
Data example:
numpy_data = np.array([[1, 2], [3, 4], [1, 1]])
df = pd.DataFrame(data=numpy_data, index=[1,2,3], columns=["column1", "column2"])
Here I get the pandas.core.frame.Pandas data type for every row:
for row in df.itertuples():
print(row)
print(type(row))
But if I read a single row I get pandas.core.series.Series type
print(type(df.iloc[1]))
How can I convert series.Series to frame.Pandas?