{"id":430,"date":"2024-08-23T23:13:32","date_gmt":"2024-08-24T02:13:32","guid":{"rendered":"https:\/\/urutaudev.com.br\/?p=430"},"modified":"2024-08-24T00:05:52","modified_gmt":"2024-08-24T03:05:52","slug":"como-ler-e-escrever-csv-com-python","status":"publish","type":"post","link":"https:\/\/urutaudev.com.br\/index.php\/2024\/08\/23\/como-ler-e-escrever-csv-com-python\/","title":{"rendered":"Como ler e escrever csv com Python"},"content":{"rendered":"<h2>Como ler e escrever csv com Python.<\/h2>\n<hr \/>\n<p>&nbsp;<\/p>\n<figure id=\"attachment_431\" aria-describedby=\"caption-attachment-431\" style=\"width: 300px\" class=\"wp-caption aligncenter\"><img loading=\"lazy\" decoding=\"async\" class=\"Como ler e escrever csv com Java wp-image-431 size-medium\" title=\"Como ler e escrever csv com Java\" src=\"https:\/\/urutaudev.com.br\/wp-content\/uploads\/2024\/08\/Como-ler-e-escrever-csv-comPython-300x169.png\" alt=\"Como ler e escrever csv comPython\" width=\"300\" height=\"169\" srcset=\"https:\/\/urutaudev.com.br\/wp-content\/uploads\/2024\/08\/Como-ler-e-escrever-csv-comPython-300x169.png 300w, https:\/\/urutaudev.com.br\/wp-content\/uploads\/2024\/08\/Como-ler-e-escrever-csv-comPython-1024x576.png 1024w, https:\/\/urutaudev.com.br\/wp-content\/uploads\/2024\/08\/Como-ler-e-escrever-csv-comPython-768x432.png 768w, https:\/\/urutaudev.com.br\/wp-content\/uploads\/2024\/08\/Como-ler-e-escrever-csv-comPython.png 1280w\" sizes=\"auto, (max-width: 300px) 100vw, 300px\" \/><figcaption id=\"caption-attachment-431\" class=\"wp-caption-text\">Como ler e escrever csv comPython<\/figcaption><\/figure>\n<p>&nbsp;<\/p>\n<h4>Neste tutorial, voc\u00ea aprender\u00e1\u00a0<strong>como ler e escrever arquivos CSV com Python<\/strong>. Vou demonstrar como realizar essas opera\u00e7\u00f5es usando apenas fun\u00e7\u00f5es nativas do Python, sem o aux\u00edlio de bibliotecas de terceiros.<\/h4>\n<h4>Para iniciar este tutorial, come\u00e7o importando a biblioteca <code>csv<\/code> do Python, que usarei para ler e escrever o arquivo (csv):<\/h4>\n<p>&nbsp;<\/p>\n<div>\n<div><code>import csv<\/code><\/div>\n<\/div>\n<p>&nbsp;<\/p>\n<div>\n<h4>Feito isto, vou come\u00e7ar a implementa\u00e7\u00e3o do c\u00f3digo que ser\u00e1 o respons\u00e1vel\u00a0 pela escrita dos dados no arquivo csv.<\/h4>\n<\/div>\n<div>\n<h4>Logo abaixo deixei o um exemplo do\u00a0 c\u00f3digo:<\/h4>\n<\/div>\n<p>&nbsp;<\/p>\n<div>\n<div><code>import csv<\/code><\/div>\n<div><code>dados = [<\/code><\/div>\n<div><code>\u00a0 \u00a0 ['Nome', 'Idade', 'Cidade'],<\/code><\/div>\n<div><code>\u00a0 \u00a0 ['Jo\u00e3o', '25', \u00a0'S\u00e3o Pauo'],<\/code><\/div>\n<div><code>\u00a0 \u00a0 ['Maria', '30', 'Rio de Janeiro'],<\/code><\/div>\n<div><code>\u00a0 \u00a0 ['Pedro', '28', 'Belo Horizonte'],<\/code><\/div>\n<div><code>]<\/code><\/div>\n<div><code>with open('arquivo.csv', mode=\"w\", newline='') as file:<\/code><\/div>\n<div><code>\u00a0 \u00a0 writer = csv.writer(file)<\/code><\/div>\n<div><code>\u00a0 \u00a0 writer.writerows(dados)<\/code><\/div>\n<\/div>\n<div><\/div>\n<div><\/div>\n<div>\n<hr \/>\n<\/div>\n<h4>Uma breve explica\u00e7\u00e3o do c\u00f3digo acima:<\/h4>\n<ul>\n<li>No c\u00f3digo acima come\u00e7o definindo a importa\u00e7\u00e3o da biblioteca (<code>csv<\/code>) do Python;<\/li>\n<li>Depois, crio uma lista que cont\u00e9m as informa\u00e7\u00f5es que adicionarei ao arquivo e as armazeno em uma vari\u00e1vel que chamo de (dados);<\/li>\n<li>Logo ap\u00f3s realizo a abertura do arquivo para leitura com (<code>with open()<\/code>) passo o nome do arquivo para fun\u00e7\u00e3o, passo tamb\u00e9m o modo (<code>w)<\/code> de escrita e o car\u00e1cter de nova linha (<code>newline=''<\/code>).<\/li>\n<li>Com isto, j\u00e1 posso fazer a escrita das informa\u00e7\u00f5es com a fun\u00e7\u00e3o (<code>writerows<\/code>) da lib (<code>csv<\/code>);<\/li>\n<\/ul>\n<p>&nbsp;<\/p>\n<h4>Quando executo o c\u00f3digo acima \u00e9 poss\u00edvel verificar que foi gerado um arquivo csv (<code>arquivo.csv<\/code>) com as informa\u00e7\u00f5es abaixo:<\/h4>\n<p><code>Nome,Idade,Cidade<\/code><br \/>\n<code>Jo\u00e3o,25,S\u00e3o Paulo<\/code><br \/>\n<code>Maria,30,Rio de Janeiro<\/code><br \/>\n<code>Pedro,23,Minas Gerais<\/code><\/p>\n<div id=\"list_id_8_0\" class=\"monaco-list-row\" role=\"treeitem\" draggable=\"false\" data-index=\"0\" data-last-element=\"false\" data-parity=\"even\" aria-setsize=\"2\" aria-posinset=\"1\" aria-selected=\"false\" aria-label=\"List Resultado Agrupado: \" aria-level=\"1\">\n<div class=\"monaco-tl-row\">\n<div class=\"monaco-tl-contents output\">\n<div class=\"output expression value-and-source\">\n<div id=\"list_id_6_0\" class=\"monaco-list-row\" role=\"treeitem\" draggable=\"false\" data-index=\"0\" data-last-element=\"false\" data-parity=\"even\" aria-setsize=\"2\" aria-posinset=\"1\" aria-selected=\"false\" aria-label=\"4 \" aria-level=\"1\">\n<div class=\"monaco-tl-row\">\n<div class=\"monaco-tl-contents output\">\n<div class=\"output expression value-and-source\">\n<div id=\"list_id_6_0\" class=\"monaco-list-row\" role=\"treeitem\" draggable=\"false\" data-index=\"0\" data-last-element=\"false\" data-parity=\"even\" aria-setsize=\"2\" aria-posinset=\"1\" aria-selected=\"false\" aria-label=\"4 \" aria-level=\"1\">\n<div class=\"monaco-tl-row\">\n<div class=\"monaco-tl-contents output\">\n<div class=\"output expression value-and-source\"><code><\/code><code><\/code><\/div>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<div>\n<div><code><\/code><\/div>\n<\/div>\n<h4><\/h4>\n<h4>Segue abaixo um pequeno v\u00eddeo onde demonstro o processo e implementa\u00e7\u00e3o do c\u00f3digo usado no <a href=\"https:\/\/urutaudev.com.br\/index.php\/category\/tutorias\/\">tutorial<\/a> :<\/h4>\n<p>&nbsp;<\/p>\n<p><iframe loading=\"lazy\" title=\"Como escrever CSV no Python #coding #python\" width=\"800\" height=\"450\" src=\"https:\/\/www.youtube.com\/embed\/joSXt4fDFT0?feature=oembed\" frameborder=\"0\" allow=\"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share\" referrerpolicy=\"strict-origin-when-cross-origin\" allowfullscreen><\/iframe><\/p>\n<h4><\/h4>\n<p>&nbsp;<\/p>\n<h4>Agora, vou iniciar implementa\u00e7\u00e3o do c\u00f3digo respons\u00e1vel pela leitura do arquivo, que gerei no c\u00f3digo anterior abaixo, mostro o c\u00f3digo que vamos usar para ler o arquivo CSV:<\/h4>\n<p>&nbsp;<\/p>\n<div>\n<div><code>import csv<\/code><\/div>\n<div><code>with open('arquivo.csv', mode='r', newline='') as file:<\/code><\/div>\n<div><code>\u00a0 \u00a0 reader = csv.reader(file)<\/code><\/div>\n<div><code>\u00a0 \u00a0 for row in reader:<\/code><\/div>\n<div><code>\u00a0 \u00a0 \u00a0 \u00a0 print(row)<\/code><\/div>\n<\/div>\n<p>&nbsp;<\/p>\n<h4>Uma breve explica\u00e7\u00e3o do c\u00f3digo acima:<\/h4>\n<ul>\n<li>No c\u00f3digo acima, primeiro importo a biblioteca <code>csv<\/code>\u00a0do Python;<\/li>\n<li>Logo ap\u00f3s, abro o arquivo para leitura com (<code>with open()<\/code>), e passo o nome do arquivo, o modo (<code>\"r\"<\/code> )de leitura e o caractere de nova linha (<code>newline=''<\/code>).;<\/li>\n<li>Ent\u00e3o atribuo o uma vari\u00e1vel passando o arquivo a ser lido com a fun\u00e7\u00e3o (<code><strong>reader<\/strong><\/code>) presente na lib(<code><strong>csv<\/strong><\/code>) ;<\/li>\n<li>Por \u00faltimo, crio um loop que itera pelas linhas do arquivo e imprimo as informa\u00e7\u00f5es na tela;<\/li>\n<\/ul>\n<p>&nbsp;<\/p>\n<h4>Em seguida quando executo o c\u00f3digo acima, \u00e9 poss\u00edvel visualisar as seguintes informa\u00e7\u00f5es no terminal:<\/h4>\n<p>&nbsp;<\/p>\n<p><code>['Nome', 'Idade', 'Cidade']<\/code><br \/>\n<code>['Jo\u00e3o', '25', 'S\u00e3o Pauo'] <\/code><br \/>\n<code>['Maria', '30', 'Rio de Janeiro']<\/code><br \/>\n<code>['Pedro', '28', 'Belo Horizonte']<\/code><\/p>\n<p>&nbsp;<\/p>\n<h4>Deixo aqui um pequeno e curto v\u00eddeo da implementa\u00e7\u00e3o do c\u00f3digo de leitura de arquivo csv em <a href=\"https:\/\/urutaudev.com.br\/index.php\/category\/tutorias\/python\/\">Python<\/a>:<\/h4>\n<p>&nbsp;<\/p>\n<p><iframe loading=\"lazy\" title=\"Como ler CSV no Python short  #coding  #python\" width=\"800\" height=\"450\" src=\"https:\/\/www.youtube.com\/embed\/yhJCCQld5Og?feature=oembed\" frameborder=\"0\" allow=\"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share\" referrerpolicy=\"strict-origin-when-cross-origin\" allowfullscreen><\/iframe><\/p>\n<p>&nbsp;<\/p>\n<h4>Caso queira acompanhar todo o processo de desenvolvimento deixo abaixo o link para o v\u00eddeo no Youtube:<\/h4>\n<p>&nbsp;<\/p>\n<p><iframe loading=\"lazy\" title=\"Como Ler e Escrever CSV no Python (Melhor que em Java)#coding #python\" width=\"800\" height=\"450\" src=\"https:\/\/www.youtube.com\/embed\/Hgsl4L6o5gE?feature=oembed\" frameborder=\"0\" allow=\"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share\" referrerpolicy=\"strict-origin-when-cross-origin\" allowfullscreen><\/iframe><\/p>\n<p>&nbsp;<\/p>\n<h4 style=\"text-align: left;\">Abaixo deixo o link do GitHub com o c\u00f3digo-fonte que utilizei para implementar este tutorial:<\/h4>\n<p>&nbsp;<\/p>\n<p><a href=\"https:\/\/github.com\/JrDevCJ\/tutorial-pyhton\/tree\/main\/utils\">C\u00f3digo Fonte CSV Read and Write<\/a><\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Como ler e escrever csv com Python. &nbsp; &nbsp; Neste tutorial, voc\u00ea aprender\u00e1\u00a0como ler e escrever arquivos CSV com Python.<\/p>\n","protected":false},"author":1,"featured_media":431,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"colormag_page_container_layout":"default_layout","colormag_page_sidebar_layout":"default_layout","footnotes":""},"categories":[16,5],"tags":[89,88,73,33],"class_list":["post-430","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-python","category-tutorias","tag-csv","tag-ler-arquivo","tag-list","tag-python"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.6 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>Como ler e escrever csv com Python - UrutauDev<\/title>\n<meta name=\"description\" content=\"Como ler e escrever csv com Python, este e um curto tutorial mostrando como \u00e9 simples a leitura de um arquivo csv no Python\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/urutaudev.com.br\/index.php\/2024\/08\/23\/como-ler-e-escrever-csv-com-python\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Como ler e escrever csv com Python - UrutauDev\" \/>\n<meta property=\"og:description\" content=\"Como ler e escrever csv com Python, este e um curto tutorial mostrando como \u00e9 simples a leitura de um arquivo csv no Python\" \/>\n<meta property=\"og:url\" content=\"https:\/\/urutaudev.com.br\/index.php\/2024\/08\/23\/como-ler-e-escrever-csv-com-python\/\" \/>\n<meta property=\"og:site_name\" content=\"UrutauDev\" \/>\n<meta property=\"article:published_time\" content=\"2024-08-24T02:13:32+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2024-08-24T03:05:52+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/urutaudev.com.br\/wp-content\/uploads\/2024\/08\/Como-ler-e-escrever-csv-comPython.png\" \/>\n\t<meta property=\"og:image:width\" content=\"1280\" \/>\n\t<meta property=\"og:image:height\" content=\"720\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/png\" \/>\n<meta name=\"author\" content=\"C. Junior\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"C. Junior\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"3 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/urutaudev.com.br\\\/index.php\\\/2024\\\/08\\\/23\\\/como-ler-e-escrever-csv-com-python\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/urutaudev.com.br\\\/index.php\\\/2024\\\/08\\\/23\\\/como-ler-e-escrever-csv-com-python\\\/\"},\"author\":{\"name\":\"C. Junior\",\"@id\":\"https:\\\/\\\/urutaudev.com.br\\\/#\\\/schema\\\/person\\\/7e321618d23a158d5a42d5cfbdd99dd6\"},\"headline\":\"Como ler e escrever csv com Python\",\"datePublished\":\"2024-08-24T02:13:32+00:00\",\"dateModified\":\"2024-08-24T03:05:52+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/urutaudev.com.br\\\/index.php\\\/2024\\\/08\\\/23\\\/como-ler-e-escrever-csv-com-python\\\/\"},\"wordCount\":485,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\\\/\\\/urutaudev.com.br\\\/#organization\"},\"image\":{\"@id\":\"https:\\\/\\\/urutaudev.com.br\\\/index.php\\\/2024\\\/08\\\/23\\\/como-ler-e-escrever-csv-com-python\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/urutaudev.com.br\\\/wp-content\\\/uploads\\\/2024\\\/08\\\/Como-ler-e-escrever-csv-comPython.png\",\"keywords\":[\"csv\",\"ler arquivo\",\"List\",\"python\"],\"articleSection\":[\"Python\",\"Tutorias\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/urutaudev.com.br\\\/index.php\\\/2024\\\/08\\\/23\\\/como-ler-e-escrever-csv-com-python\\\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/urutaudev.com.br\\\/index.php\\\/2024\\\/08\\\/23\\\/como-ler-e-escrever-csv-com-python\\\/\",\"url\":\"https:\\\/\\\/urutaudev.com.br\\\/index.php\\\/2024\\\/08\\\/23\\\/como-ler-e-escrever-csv-com-python\\\/\",\"name\":\"Como ler e escrever csv com Python - UrutauDev\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/urutaudev.com.br\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/urutaudev.com.br\\\/index.php\\\/2024\\\/08\\\/23\\\/como-ler-e-escrever-csv-com-python\\\/#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/urutaudev.com.br\\\/index.php\\\/2024\\\/08\\\/23\\\/como-ler-e-escrever-csv-com-python\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/urutaudev.com.br\\\/wp-content\\\/uploads\\\/2024\\\/08\\\/Como-ler-e-escrever-csv-comPython.png\",\"datePublished\":\"2024-08-24T02:13:32+00:00\",\"dateModified\":\"2024-08-24T03:05:52+00:00\",\"description\":\"Como ler e escrever csv com Python, este e um curto tutorial mostrando como \u00e9 simples a leitura de um arquivo csv no Python\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/urutaudev.com.br\\\/index.php\\\/2024\\\/08\\\/23\\\/como-ler-e-escrever-csv-com-python\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/urutaudev.com.br\\\/index.php\\\/2024\\\/08\\\/23\\\/como-ler-e-escrever-csv-com-python\\\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/urutaudev.com.br\\\/index.php\\\/2024\\\/08\\\/23\\\/como-ler-e-escrever-csv-com-python\\\/#primaryimage\",\"url\":\"https:\\\/\\\/urutaudev.com.br\\\/wp-content\\\/uploads\\\/2024\\\/08\\\/Como-ler-e-escrever-csv-comPython.png\",\"contentUrl\":\"https:\\\/\\\/urutaudev.com.br\\\/wp-content\\\/uploads\\\/2024\\\/08\\\/Como-ler-e-escrever-csv-comPython.png\",\"width\":1280,\"height\":720,\"caption\":\"Como ler e escrever csv comPython\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/urutaudev.com.br\\\/index.php\\\/2024\\\/08\\\/23\\\/como-ler-e-escrever-csv-com-python\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"In\u00edcio\",\"item\":\"https:\\\/\\\/urutaudev.com.br\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Como ler e escrever csv com Python\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/urutaudev.com.br\\\/#website\",\"url\":\"https:\\\/\\\/urutaudev.com.br\\\/\",\"name\":\"UrutauDev\",\"description\":\"\",\"publisher\":{\"@id\":\"https:\\\/\\\/urutaudev.com.br\\\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/urutaudev.com.br\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\\\/\\\/urutaudev.com.br\\\/#organization\",\"name\":\"UrutauDev\",\"url\":\"https:\\\/\\\/urutaudev.com.br\\\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/urutaudev.com.br\\\/#\\\/schema\\\/logo\\\/image\\\/\",\"url\":\"https:\\\/\\\/urutaudev.com.br\\\/wp-content\\\/uploads\\\/2023\\\/08\\\/cropped-urutau-dev-logo.png\",\"contentUrl\":\"https:\\\/\\\/urutaudev.com.br\\\/wp-content\\\/uploads\\\/2023\\\/08\\\/cropped-urutau-dev-logo.png\",\"width\":100,\"height\":84,\"caption\":\"UrutauDev\"},\"image\":{\"@id\":\"https:\\\/\\\/urutaudev.com.br\\\/#\\\/schema\\\/logo\\\/image\\\/\"}},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/urutaudev.com.br\\\/#\\\/schema\\\/person\\\/7e321618d23a158d5a42d5cfbdd99dd6\",\"name\":\"C. Junior\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/e7df4c63012e2f6991311d4037bdc57752b996058cf1396747a7ab74e8ac032e?s=96&d=mm&r=g\",\"url\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/e7df4c63012e2f6991311d4037bdc57752b996058cf1396747a7ab74e8ac032e?s=96&d=mm&r=g\",\"contentUrl\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/e7df4c63012e2f6991311d4037bdc57752b996058cf1396747a7ab74e8ac032e?s=96&d=mm&r=g\",\"caption\":\"C. Junior\"},\"sameAs\":[\"http:\\\/\\\/urutaudev.com.br\",\"instagram.com\\\/urutautec\",\"https:\\\/\\\/www.youtube.com\\\/channel\\\/UC8pDLb5GaYBAoWwQkIzrhRw\"],\"url\":\"https:\\\/\\\/urutaudev.com.br\\\/index.php\\\/author\\\/urutaudev-com-br\\\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Como ler e escrever csv com Python - UrutauDev","description":"Como ler e escrever csv com Python, este e um curto tutorial mostrando como \u00e9 simples a leitura de um arquivo csv no Python","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/urutaudev.com.br\/index.php\/2024\/08\/23\/como-ler-e-escrever-csv-com-python\/","og_locale":"en_US","og_type":"article","og_title":"Como ler e escrever csv com Python - UrutauDev","og_description":"Como ler e escrever csv com Python, este e um curto tutorial mostrando como \u00e9 simples a leitura de um arquivo csv no Python","og_url":"https:\/\/urutaudev.com.br\/index.php\/2024\/08\/23\/como-ler-e-escrever-csv-com-python\/","og_site_name":"UrutauDev","article_published_time":"2024-08-24T02:13:32+00:00","article_modified_time":"2024-08-24T03:05:52+00:00","og_image":[{"width":1280,"height":720,"url":"https:\/\/urutaudev.com.br\/wp-content\/uploads\/2024\/08\/Como-ler-e-escrever-csv-comPython.png","type":"image\/png"}],"author":"C. Junior","twitter_card":"summary_large_image","twitter_misc":{"Written by":"C. Junior","Est. reading time":"3 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/urutaudev.com.br\/index.php\/2024\/08\/23\/como-ler-e-escrever-csv-com-python\/#article","isPartOf":{"@id":"https:\/\/urutaudev.com.br\/index.php\/2024\/08\/23\/como-ler-e-escrever-csv-com-python\/"},"author":{"name":"C. Junior","@id":"https:\/\/urutaudev.com.br\/#\/schema\/person\/7e321618d23a158d5a42d5cfbdd99dd6"},"headline":"Como ler e escrever csv com Python","datePublished":"2024-08-24T02:13:32+00:00","dateModified":"2024-08-24T03:05:52+00:00","mainEntityOfPage":{"@id":"https:\/\/urutaudev.com.br\/index.php\/2024\/08\/23\/como-ler-e-escrever-csv-com-python\/"},"wordCount":485,"commentCount":0,"publisher":{"@id":"https:\/\/urutaudev.com.br\/#organization"},"image":{"@id":"https:\/\/urutaudev.com.br\/index.php\/2024\/08\/23\/como-ler-e-escrever-csv-com-python\/#primaryimage"},"thumbnailUrl":"https:\/\/urutaudev.com.br\/wp-content\/uploads\/2024\/08\/Como-ler-e-escrever-csv-comPython.png","keywords":["csv","ler arquivo","List","python"],"articleSection":["Python","Tutorias"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/urutaudev.com.br\/index.php\/2024\/08\/23\/como-ler-e-escrever-csv-com-python\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/urutaudev.com.br\/index.php\/2024\/08\/23\/como-ler-e-escrever-csv-com-python\/","url":"https:\/\/urutaudev.com.br\/index.php\/2024\/08\/23\/como-ler-e-escrever-csv-com-python\/","name":"Como ler e escrever csv com Python - UrutauDev","isPartOf":{"@id":"https:\/\/urutaudev.com.br\/#website"},"primaryImageOfPage":{"@id":"https:\/\/urutaudev.com.br\/index.php\/2024\/08\/23\/como-ler-e-escrever-csv-com-python\/#primaryimage"},"image":{"@id":"https:\/\/urutaudev.com.br\/index.php\/2024\/08\/23\/como-ler-e-escrever-csv-com-python\/#primaryimage"},"thumbnailUrl":"https:\/\/urutaudev.com.br\/wp-content\/uploads\/2024\/08\/Como-ler-e-escrever-csv-comPython.png","datePublished":"2024-08-24T02:13:32+00:00","dateModified":"2024-08-24T03:05:52+00:00","description":"Como ler e escrever csv com Python, este e um curto tutorial mostrando como \u00e9 simples a leitura de um arquivo csv no Python","breadcrumb":{"@id":"https:\/\/urutaudev.com.br\/index.php\/2024\/08\/23\/como-ler-e-escrever-csv-com-python\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/urutaudev.com.br\/index.php\/2024\/08\/23\/como-ler-e-escrever-csv-com-python\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/urutaudev.com.br\/index.php\/2024\/08\/23\/como-ler-e-escrever-csv-com-python\/#primaryimage","url":"https:\/\/urutaudev.com.br\/wp-content\/uploads\/2024\/08\/Como-ler-e-escrever-csv-comPython.png","contentUrl":"https:\/\/urutaudev.com.br\/wp-content\/uploads\/2024\/08\/Como-ler-e-escrever-csv-comPython.png","width":1280,"height":720,"caption":"Como ler e escrever csv comPython"},{"@type":"BreadcrumbList","@id":"https:\/\/urutaudev.com.br\/index.php\/2024\/08\/23\/como-ler-e-escrever-csv-com-python\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"In\u00edcio","item":"https:\/\/urutaudev.com.br\/"},{"@type":"ListItem","position":2,"name":"Como ler e escrever csv com Python"}]},{"@type":"WebSite","@id":"https:\/\/urutaudev.com.br\/#website","url":"https:\/\/urutaudev.com.br\/","name":"UrutauDev","description":"","publisher":{"@id":"https:\/\/urutaudev.com.br\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/urutaudev.com.br\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/urutaudev.com.br\/#organization","name":"UrutauDev","url":"https:\/\/urutaudev.com.br\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/urutaudev.com.br\/#\/schema\/logo\/image\/","url":"https:\/\/urutaudev.com.br\/wp-content\/uploads\/2023\/08\/cropped-urutau-dev-logo.png","contentUrl":"https:\/\/urutaudev.com.br\/wp-content\/uploads\/2023\/08\/cropped-urutau-dev-logo.png","width":100,"height":84,"caption":"UrutauDev"},"image":{"@id":"https:\/\/urutaudev.com.br\/#\/schema\/logo\/image\/"}},{"@type":"Person","@id":"https:\/\/urutaudev.com.br\/#\/schema\/person\/7e321618d23a158d5a42d5cfbdd99dd6","name":"C. Junior","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/secure.gravatar.com\/avatar\/e7df4c63012e2f6991311d4037bdc57752b996058cf1396747a7ab74e8ac032e?s=96&d=mm&r=g","url":"https:\/\/secure.gravatar.com\/avatar\/e7df4c63012e2f6991311d4037bdc57752b996058cf1396747a7ab74e8ac032e?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/e7df4c63012e2f6991311d4037bdc57752b996058cf1396747a7ab74e8ac032e?s=96&d=mm&r=g","caption":"C. Junior"},"sameAs":["http:\/\/urutaudev.com.br","instagram.com\/urutautec","https:\/\/www.youtube.com\/channel\/UC8pDLb5GaYBAoWwQkIzrhRw"],"url":"https:\/\/urutaudev.com.br\/index.php\/author\/urutaudev-com-br\/"}]}},"_links":{"self":[{"href":"https:\/\/urutaudev.com.br\/index.php\/wp-json\/wp\/v2\/posts\/430","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/urutaudev.com.br\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/urutaudev.com.br\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/urutaudev.com.br\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/urutaudev.com.br\/index.php\/wp-json\/wp\/v2\/comments?post=430"}],"version-history":[{"count":38,"href":"https:\/\/urutaudev.com.br\/index.php\/wp-json\/wp\/v2\/posts\/430\/revisions"}],"predecessor-version":[{"id":470,"href":"https:\/\/urutaudev.com.br\/index.php\/wp-json\/wp\/v2\/posts\/430\/revisions\/470"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/urutaudev.com.br\/index.php\/wp-json\/wp\/v2\/media\/431"}],"wp:attachment":[{"href":"https:\/\/urutaudev.com.br\/index.php\/wp-json\/wp\/v2\/media?parent=430"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/urutaudev.com.br\/index.php\/wp-json\/wp\/v2\/categories?post=430"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/urutaudev.com.br\/index.php\/wp-json\/wp\/v2\/tags?post=430"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}