数据:
转换代码:嘿嘿嘿,导包和print不算,刚好两行
import numpy as np
import pandas as pd
df = pd.read_excel(r'river_data.xlsx')
print(type(df))
print(df.values)
np.array(df)
print(type(np.array(df)))
转换结果:
转换前:<class ‘pandas.core.frame.DataFrame’>,转换后:<class ‘numpy.ndarray’>