Skip to content

Instantly share code, notes, and snippets.

@fcunhaneto
Last active September 4, 2018 17:04
Show Gist options
  • Save fcunhaneto/9305717e50c3c2a1996a28d24c16341a to your computer and use it in GitHub Desktop.
Save fcunhaneto/9305717e50c3c2a1996a28d24c16341a to your computer and use it in GitHub Desktop.
Pandas lendo arquivos .csv
import pandas as pl
import matplotlib.pyplot as plt
"""
Lendo um arquivo .csv com pandas e criando um pandas data frame
"""
dataframe = pl.read_csv('/home/francisco/Projects/Pycharm/matplot-pandas-tutorial'
'/files/annual-real-gnp-us-1909-to-1970.csv')
plt.figure(figsize=(8, 6))
plt.plot(dataframe['Year'], dataframe['GNP'])
plt.xlabel('Year')
plt.ylabel('GNP')
plt.title('Annual Real USA GNP 1909 to 1970')
plt.savefig('annual-real-gnp-us-1909-to-1970.png')
plt.close()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment