Skip to content

Commit a05333f

Browse files
author
root
committed
added pandas
1 parent a838ebc commit a05333f

File tree

4 files changed

+714
-0
lines changed

4 files changed

+714
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
{
2+
"cells": [],
3+
"metadata": {},
4+
"nbformat": 4,
5+
"nbformat_minor": 2
6+
}
+135
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,135 @@
1+
{
2+
"cells": [
3+
{
4+
"cell_type": "code",
5+
"execution_count": 3,
6+
"metadata": {},
7+
"outputs": [],
8+
"source": [
9+
"import pandas as pd\n"
10+
]
11+
},
12+
{
13+
"cell_type": "code",
14+
"execution_count": 16,
15+
"metadata": {},
16+
"outputs": [],
17+
"source": [
18+
"#series-1D\n",
19+
"\n",
20+
"s=pd.Series([1.0,2,3,4],['a','b','c','e'])"
21+
]
22+
},
23+
{
24+
"cell_type": "code",
25+
"execution_count": 14,
26+
"metadata": {},
27+
"outputs": [
28+
{
29+
"name": "stdout",
30+
"output_type": "stream",
31+
"text": [
32+
"0 1.0\n",
33+
"1 2.0\n",
34+
"2 3.0\n",
35+
"3 4.0\n",
36+
"4 5.0\n",
37+
"5 6.0\n",
38+
"dtype: float64\n"
39+
]
40+
}
41+
],
42+
"source": [
43+
"print(s)"
44+
]
45+
},
46+
{
47+
"cell_type": "code",
48+
"execution_count": 31,
49+
"metadata": {},
50+
"outputs": [],
51+
"source": [
52+
"#dataframes-2D\n",
53+
"#pd.DataFrame(data,index,column,datatype)\n",
54+
"df=pd.DataFrame([[1,2],[3,4],[5,6]],index=['x','y','z'],columns=['a','b'])"
55+
]
56+
},
57+
{
58+
"cell_type": "code",
59+
"execution_count": 32,
60+
"metadata": {},
61+
"outputs": [
62+
{
63+
"name": "stdout",
64+
"output_type": "stream",
65+
"text": [
66+
" a b\n",
67+
"x 1 2\n",
68+
"y 3 4\n",
69+
"z 5 6\n"
70+
]
71+
}
72+
],
73+
"source": [
74+
"print(df)"
75+
]
76+
},
77+
{
78+
"cell_type": "code",
79+
"execution_count": 36,
80+
"metadata": {},
81+
"outputs": [],
82+
"source": [
83+
"df=pd.DataFrame({'a':[1,2,3],'b':[2,3,4],'c':[3,4,5]},index=[1,2,3])"
84+
]
85+
},
86+
{
87+
"cell_type": "code",
88+
"execution_count": 37,
89+
"metadata": {},
90+
"outputs": [
91+
{
92+
"name": "stdout",
93+
"output_type": "stream",
94+
"text": [
95+
" a b c\n",
96+
"1 1 2 3\n",
97+
"2 2 3 4\n",
98+
"3 3 4 5\n"
99+
]
100+
}
101+
],
102+
"source": [
103+
"print(df)"
104+
]
105+
},
106+
{
107+
"cell_type": "code",
108+
"execution_count": null,
109+
"metadata": {},
110+
"outputs": [],
111+
"source": []
112+
}
113+
],
114+
"metadata": {
115+
"kernelspec": {
116+
"display_name": "Python 3",
117+
"language": "python",
118+
"name": "python3"
119+
},
120+
"language_info": {
121+
"codemirror_mode": {
122+
"name": "ipython",
123+
"version": 3
124+
},
125+
"file_extension": ".py",
126+
"mimetype": "text/x-python",
127+
"name": "python",
128+
"nbconvert_exporter": "python",
129+
"pygments_lexer": "ipython3",
130+
"version": "3.5.2"
131+
}
132+
},
133+
"nbformat": 4,
134+
"nbformat_minor": 2
135+
}

0 commit comments

Comments
 (0)