Python Forum
Python csv loading help
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Python csv loading help
#1
Hello,

I'm just starting out learning python and wanted to see if someone could help me out with loading my csv data.

I have the following information in a CSV file:

header row
column A - Date
Column B - Airport code
Column c - Passengers
Column D - Bookings

I'm not sure if the following code is correct:

# import CSV data

import pandas as pd
file = 'DESTINATION_DATA.csv'
data = pd.ExcelFile(file)
print(data.sheet_names)
['DEST_DATA']
df1 = data.parse('DEST_DATA')
df2 = data.parse(0)

Can someone help me with the import code and reading the data? Also explain how to load without using pandas.

Any help would be greatly appreciated.

Thanks,

Tim
Reply
#2
(Nov-28-2018, 07:42 PM)mulltr66 Wrote: Also explain how to load without using pandas.
The csv module? https://docs.python.org/3/library/csv.html
Reply


Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020