Python Forum
[solved] dataframe and read_csv
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
[solved] dataframe and read_csv
#2
Hello,

I.m not an expert with pandas, however:
  • data is already a dataframe.
  • drop lines 10 - 13 and all will be fine.

import pandas as pd
import numpy as np
 
from datetime import datetime, timedelta
 
# read data, date_parser=[0]: first column to datetime, 
data = pd.read_csv('minimal_data.csv', delimiter = ';', date_parser=[0], usecols=[0, 1], header = 0, names = ["MyColumn1","MyColumn2"]), 
    
print(data)    
Output:
( MyColumn1 MyColumn2 0 09.06.2021 14:35:05 100 1 09.06.2021 14:36:16 100 2 09.06.2021 14:37:26 100 3 09.06.2021 14:38:37 100 4 09.06.2021 14:39:48 100 5 09.06.2021 14:40:59 100 6 09.06.2021 14:42:10 100 7 09.06.2021 14:43:21 100 8 09.06.2021 14:44:32 100,)
Reply


Messages In This Thread
[solved] dataframe and read_csv - by ju21878436312 - Jun-15-2021, 09:44 AM
RE: dataframe and read_csv - by Larz60+ - Jun-15-2021, 01:01 PM
RE: dataframe and read_csv - by ju21878436312 - Jun-15-2021, 01:26 PM
RE: dataframe and read_csv - by snippsat - Jun-15-2021, 03:04 PM
RE: dataframe and read_csv - by ju21878436312 - Jun-16-2021, 06:01 AM

Possibly Related Threads…
Thread Author Replies Views Last Post
  [Solved] Delete a line in a dataframe using .reset_index() and .drop() ju21878436312 2 2,739 Feb-25-2022, 02:55 PM
Last Post: ju21878436312
  read_csv error ilcaa72 2 3,195 May-29-2019, 02:58 PM
Last Post: ilcaa72
  Pandas Dataframe through read_csv() ift38375 1 2,244 May-29-2019, 05:56 AM
Last Post: buran

Forum Jump:

User Panel Messages

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