Home > Enterprise >  Pandas Dataframe is not pretty displayed
Pandas Dataframe is not pretty displayed

Time:06-26

Well I am trying to create a dataframe in pandas and print it reading a csv file, however it is not pretty displayed

This is the code:

import pandas as pd
df = pd.read_csv("weather.csv")
print(df)

And this is my output:

And this is my output (image)

What can I do?

CodePudding user response:

A sample of weather.csv would help but I believe that this will solve the issue:

import pandas as pd
df = pd.read_csv("weather.csv", sep=';')
print(df)

CodePudding user response:

Next time try to provide your data in text. You need to change separator, default is ','. So try this:

df = pd.read_csv('weather.csv', sep=';')
  • Related