I’ve been looking online for a long time. Either the data frame is transformed into array or the array is transformed into data frame. So here’s a summary. The python generation of mutual transformation is as follows:
Transform dataframe into array
and
df=df.values
Transform array into dataframe
import pandas as pd
df = pd.DataFrame(df)
That’s OK!
Read More:
- Dataframe and np.array The mutual transformation of
- Three methods of converting dict into dataframe by pandas
- Summary of three methods for pandas to convert dict into dataframe
- Methods of modifying index and columns names by dataframe in pandas
- Array of PHP_ diff,array_ intersect,array_ merge, in_ Is there a limit on the number of arrays in array?
- [Python] numpy library array splicing np.concatenate Detailed explanation and examples of official documents
- Two dimensional array and pointer to one dimensional array
- Using np.set in Python 3_ Printoptions (threshold = NP. Nan) raises an error resolution
- Converting string object into datetime type in pandas
- [solved] error: valueerror: expected 2D array, got scalar array instead
- Attributeerror: ‘dataframe’ object has no attribute ‘IX’ error
- Problem solving: Pandas: keyerror: [ ] not in index
- [leetcode] zigzag transformation
- Mutual conversion between date and localdatetime
- Pandas multi column pandas.core.indexing . indexingerror: too many indexers error
- np.unique Usage of ()
- Variable type error: error of array occurs when TP5 controller receives the array of post
- Pandas memory error
- Pandas read_ Error in json() valueerror: training data
- JavaScript removes the number specified in the array