You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
sex age sibsp parch ticket fare cabin embarked boat \
40
-
0 female 29.00 0 0 24160 211.3375 B5 S 2
41
-
1 male 0.92 1 2 113781 151.5500 C22 C26 S 11
42
-
2 female 2.00 1 2 113781 151.5500 C22 C26 S NaN
43
-
3 male 30.00 1 2 113781 151.5500 C22 C26 S NaN
44
-
4 female 25.00 1 2 113781 151.5500 C22 C26 S NaN
45
-
... ... ... ... ... ... ... ... ... ...
46
-
1304 female 14.50 1 0 2665 14.4542 NaN C NaN
47
-
1305 female NaN 1 0 2665 14.4542 NaN C NaN
48
-
1306 male 26.50 0 0 2656 7.2250 NaN C NaN
49
-
1307 male 27.00 0 0 2670 7.2250 NaN C NaN
50
-
1308 male 29.00 0 0 315082 7.8750 NaN S NaN
51
-
52
-
body home.dest
53
-
0 NaN St Louis, MO
54
-
1 NaN Montreal, PQ / Chesterville, ON
55
-
2 NaN Montreal, PQ / Chesterville, ON
56
-
3 135.0 Montreal, PQ / Chesterville, ON
57
-
4 NaN Montreal, PQ / Chesterville, ON
58
-
... ... ...
59
-
1304 328.0 NaN
60
-
1305 NaN NaN
61
-
1306 304.0 NaN
62
-
1307 NaN NaN
63
-
1308 NaN NaN
64
-
65
-
[1309 rows x 14 columns]
26
+
Make Colour Odometer (KM) Doors Price
27
+
0 Toyota White 150043 4 $4,000.00
28
+
1 Honda Red 87899 4 $5,000.00
29
+
2 Toyota Blue 32549 3 $7,000.00
30
+
3 BMW Black 11179 5 $22,000.00
31
+
4 Nissan White 213095 4 $3,500.00
32
+
5 Toyota Green 99213 4 $4,500.00
33
+
6 Honda Blue 45698 4 $7,500.00
34
+
7 Honda Blue 54738 4 $7,000.00
35
+
8 Toyota White 60000 4 $6,250.00
36
+
9 Nissan White 31600 4 $9,700.00
66
37
67
38
68
-
The dataset I am using here for your reference is taken from the same repository i.e ``learn-python`` (https://raw.githubusercontent.com/kRiShNa-429407/learn-python/main/contrib/pandas/Datasets/Titanic.csv) I uploaded it in the Datasets folder,you can use it from there.
39
+
The dataset I am using here for your reference is taken from the same repository i.e ``learn-python`` (https://raw.githubusercontent.com/kRiShNa-429407/learn-python/main/contrib/pandas/Datasets/car-sales.csv) I uploaded it in the Datasets folder,you can use it from there.
69
40
70
41
You can also place the filename with its path in `pd.read_csv()`.
71
42
@@ -92,12 +63,12 @@ You can also place the filename with its path in `pd.read_csv()`.
92
63
93
64
### Exporting a dataframe to a CSV
94
65
95
-
**We haven't made any changes yet to the ``titanic_df`` DataFrame but let's try to export it.**
66
+
**We haven't made any changes yet to the ``car_sales_df`` DataFrame but let's try to export it.**
96
67
97
68
98
69
```python
99
70
#Export the titanic_df DataFrame to csv
100
-
titanic_df.to_csv("exported_titanic.csv")
71
+
car_sales_df.to_csv("exported_car_sales_df.csv")
101
72
```
102
73
103
74
Running this will save a file called ``exported_titanic.csv`` to the current folder.
0 commit comments