Created
April 19, 2018 09:40
-
-
Save canwe/dd4f2e58d202865415ae47e768681a84 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# -*- coding: utf-8 -*- | |
""" | |
create DataFrame object | |
@author: Dazhuang | |
""" | |
import pandas as pd | |
music_data = [("the rolling stones","Satisfaction"),("Beatles","Let It Be"),("Guns N' Roses","Don't Cry"),("Metallica","Nothing Else Matters")] | |
music_table = pd.DataFrame(music_data) | |
music_table.index = range(1, 5) | |
music_table.columns = ['singer', 'song_name'] | |
print(music_table) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
1 the rolling stones Satisfaction
2 Beatles Let It Be
3 Guns N' Roses Don't Cry
4 Metallica Nothing Else Matters