Jun-15-2021, 09:44 AM
(This post was last modified: Jun-16-2021, 06:00 AM by ju21878436312.)
Aim: I would like to convert data, read with read_csv and convert it to a dataframe.
What I've tried: 1. data = pd.read_csv(...) 2. pd.DataFrame(data)
Problem: The columns are not shown in the dataframe as expected in 2 columns.
MacOS 10.15.7, Jupyter notebook
What I've tried: 1. data = pd.read_csv(...) 2. pd.DataFrame(data)
Problem: The columns are not shown in the dataframe as expected in 2 columns.
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) df = pd.DataFrame(data) print(df)---
MacOS 10.15.7, Jupyter notebook
Attached Files
minimal_data.csv (Size: 418 bytes / Downloads: 268)