Answers for "what is from_records in DataFrame() pandas in python?"

0

what is from_records in DataFrame() pandas in python?

#import pandas as pd
import pandas as pd
#import numpy as np
import numpy as np
data = np.array([(3, 'a'), (2, 'b'), (1, 'c'), (0, 'd')],dtype=[('col_1', 'i4'), ('col_2', 'U1')])
print("ndarray is:",data)
df=pd.DataFrame.from_records(data)
print("----------The DataFrame is----------")
print(df)
Posted by: Guest on April-20-2021

Code answers related to "what is from_records in DataFrame() pandas in python?"

Python Answers by Framework

Browse Popular Code Answers by Language