Skip to content

Instantly share code, notes, and snippets.

@Manikant92
Created July 20, 2018 10:42
Show Gist options
  • Save Manikant92/5dd443736d4e089dc2daa651119cf98a to your computer and use it in GitHub Desktop.
Save Manikant92/5dd443736d4e089dc2daa651119cf98a to your computer and use it in GitHub Desktop.
#dictionary
#passing all values of list x into key X in dictionary and similiarly for y
dictionary = {'X': x, 'y':y}
#import pandas for dataframe.
import pandas as pd
#call DataFrame method from pandas and pass dictionary variable to it.
#and store the dataframe in a variable to access as and when required
df = pd.DataFrame(dictionary)
#output of dataframe 1st rows -df.head()
X y
0 1 11
1 2 22
2 3 33
3 4 44
4 5 55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment