Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import pandas as pd
- # if you want to rename the column names
- df = pd.read_csv(r'C:/Users/eli/Desktop/listings.csv', skiprows = 3, skipfooter = 2, header = None, names = ['Survived','Age', 'Class', 'Gender', 'Ticket_price'])
- # in JupyterLite
- df = pd.read_csv('movies_complete.csv',engine="python",on_bad_lines='skip', parse_dates=['release_date'])
- df.head()
- # the df will has index "Athlete" and we will import only three columns
- df = pd.read_csv(r'summer_csv', index_col = "Athlete", usecols = ['Country', 'Name', 'Medals')
- # write to csv file
- df.to_csv('new_df.csv', index = False)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement