Skip to content

Commit 2e401e1

Browse files
converted plot-data-from-csv
1 parent 5e55bcb commit 2e401e1

File tree

2 files changed

+71
-135
lines changed

2 files changed

+71
-135
lines changed

python/plot-data-from-csv.md

Lines changed: 71 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
1+
---
2+
jupyter:
3+
jupytext:
4+
notebook_metadata_filter: all
5+
text_representation:
6+
extension: .md
7+
format_name: markdown
8+
format_version: '1.1'
9+
jupytext_version: 1.2.0
10+
kernelspec:
11+
display_name: Python 3
12+
language: python
13+
name: python3
14+
language_info:
15+
codemirror_mode:
16+
name: ipython
17+
version: 3
18+
file_extension: .py
19+
mimetype: text/x-python
20+
name: python
21+
nbconvert_exporter: python
22+
pygments_lexer: ipython3
23+
version: 3.6.8
24+
plotly:
25+
description: How to create charts from csv files with Plotly and Python
26+
display_as: databases
27+
has_thumbnail: false
28+
ipynb: ~notebook_demo/84
29+
language: python
30+
layout: user-guide
31+
name: Plot CSV Data
32+
order: 1
33+
page_type: example_index
34+
permalink: python/plot-data-from-csv/
35+
thumbnail: thumbnail/csv.jpg
36+
title: Plot Data from CSV | plotly
37+
---
38+
39+
40+
#### Imports
41+
42+
#### A Simple Example
43+
CSV or comma-delimited-values is a very popular format for storing structured data. In this tutorial, we will see how to plot beautiful graphs using csv data, and Pandas. We will learn how to import csv data from an external source (a url), and plot it using Plotly and pandas.
44+
45+
First we import the data and look at it.
46+
47+
```python
48+
import pandas as pd
49+
df = pd.read_csv('https://raw.githubusercontent.com/plotly/datasets/master/2014_apple_stock.csv')
50+
df.head()
51+
```
52+
53+
```python
54+
import pandas as pd
55+
import plotly.graph_objects as go
56+
57+
df = pd.read_csv('https://raw.githubusercontent.com/plotly/datasets/master/2014_apple_stock.csv')
58+
59+
fig = go.Figure(go.Scatter(x = df['AAPL_x'], y = df['AAPL_y'],
60+
name='Share Prices (in USD)'))
61+
62+
fig.update_layout(title='Apple Share Prices over time (2014)',
63+
plot_bgcolor='rgb(230, 230,230)',
64+
showlegend=True)
65+
66+
fig.show()
67+
```
68+
69+
70+
#### Reference
71+
See https://plot.ly/python/getting-started for more information about Plotly's Python API!

unconverted/python/plot-data-from-csv.md

Lines changed: 0 additions & 135 deletions
This file was deleted.

0 commit comments

Comments
 (0)