With the help panda library create a dataframe using the concept of
dictionary of lists where Keys and Values of dictionary take the data as
# Python 3.9.5
import pandas as pd # Сonnect the library pandas
data = {'col_1': [3, 2, 1, 0],
'col_2': ['a', 'b', 'c', 'd'],
'col_3': ['%', '#', '$', '&']} # Data
dataframe = pd.DataFrame.from_dict(data) # Create a dataframe using the
# concept of dictionary of lists
print(dataframe) # Display the result
Comments
Leave a comment