Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit 8e98297

Browse files
path updated
1 parent 0676aa2 commit 8e98297

File tree

8 files changed

+1725
-15
lines changed

8 files changed

+1725
-15
lines changed
Lines changed: 75 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,75 @@
1+
{
2+
"cells": [
3+
{
4+
"cell_type": "markdown",
5+
"metadata": {},
6+
"source": [
7+
"# Read files from a dataframe"
8+
]
9+
},
10+
{
11+
"cell_type": "code",
12+
"execution_count": 1,
13+
"metadata": {},
14+
"outputs": [],
15+
"source": [
16+
"\n",
17+
"#Load pandas library\n",
18+
"import pandas as pd \n",
19+
"import seaborn as sns\n"
20+
]
21+
},
22+
{
23+
"cell_type": "code",
24+
"execution_count": 2,
25+
"metadata": {},
26+
"outputs": [],
27+
"source": [
28+
"#URL of the dataset (acknowledgement to Michael Waskom who hosted this data in his github repo)\n",
29+
"diamonds_url = \"https://raw.githubusercontent.com/TrainingByPackt/Interactive-Data-Visualization-with-Python/master/datasets/diamonds.csv\"\n"
30+
]
31+
},
32+
{
33+
"cell_type": "code",
34+
"execution_count": 3,
35+
"metadata": {},
36+
"outputs": [],
37+
"source": [
38+
"#Yes, we can read files from a URL straight into a pandas dataframe!\n",
39+
"\n",
40+
"diamonds_df = pd.read_csv(diamonds_url)\n",
41+
"# Since the dataset is available in seaborn, we can alternatively read it in using the following line of code\n",
42+
"\n",
43+
"diamonds_df = sns.load_dataset('diamonds')\n"
44+
]
45+
},
46+
{
47+
"cell_type": "code",
48+
"execution_count": null,
49+
"metadata": {},
50+
"outputs": [],
51+
"source": []
52+
}
53+
],
54+
"metadata": {
55+
"kernelspec": {
56+
"display_name": "Python 3",
57+
"language": "python",
58+
"name": "python3"
59+
},
60+
"language_info": {
61+
"codemirror_mode": {
62+
"name": "ipython",
63+
"version": 3
64+
},
65+
"file_extension": ".py",
66+
"mimetype": "text/x-python",
67+
"name": "python",
68+
"nbconvert_exporter": "python",
69+
"pygments_lexer": "ipython3",
70+
"version": "3.7.3"
71+
}
72+
},
73+
"nbformat": 4,
74+
"nbformat_minor": 2
75+
}

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /