|
43 | 43 | " \"Hours\",\n", |
44 | 44 | "]\n", |
45 | 45 | "# read CSV file, parsing dates\n", |
46 | | - "source = pd.read_csv(DATA_SOURCE, dtype=dtypes, usecols=cols, parse_dates=[\"Date\"], cache_dates=True)\n", |
47 | | - "source.dtypes" |
| 46 | + "source = pd.read_csv(DATA_SOURCE, dtype=dtypes, usecols=cols, parse_dates=[\"Date\"], cache_dates=True)" |
48 | 47 | ] |
49 | 48 | }, |
50 | 49 | { |
|
54 | 53 | "outputs": [], |
55 | 54 | "source": [ |
56 | 55 | "# rename columns that can be imported as-is\n", |
57 | | - "source.rename(columns={\"Project\": \"Task\", \"Notes\": \"Description\", \"Date\": \"Start Date\"}, inplace=True)\n", |
58 | | - "source.dtypes" |
| 56 | + "source.rename(columns={\"Project\": \"Task\", \"Notes\": \"Description\", \"Date\": \"Start Date\"}, inplace=True)" |
59 | 57 | ] |
60 | 58 | }, |
61 | 59 | { |
|
70 | 68 | "source[\"Project\"] = \"Xentrans\"\n", |
71 | 69 | "source[\"Project\"] = source[\"Project\"].astype(\"category\")\n", |
72 | 70 | "source[\"Billable\"] = \"Yes\"\n", |
73 | | - "source[\"Billable\"] = source[\"Billable\"].astype(\"category\")\n", |
74 | | - "source.dtypes" |
| 71 | + "source[\"Billable\"] = source[\"Billable\"].astype(\"category\")" |
75 | 72 | ] |
76 | 73 | }, |
77 | 74 | { |
|
83 | 80 | "# add the Email column\n", |
84 | 81 | "source[\"Email\"] = source[\"First Name\"].apply(lambda x: f\"{x.lower()}@compiler.la\").astype(\"category\")\n", |
85 | 82 | "# drop individual name columns\n", |
86 | | - "source.drop(columns=[\"First Name\", \"Last Name\"], inplace=True)\n", |
87 | | - "source.dtypes" |
| 83 | + "source.drop(columns=[\"First Name\", \"Last Name\"], inplace=True)" |
88 | 84 | ] |
89 | 85 | }, |
90 | 86 | { |
|
104 | 100 | "outputs": [], |
105 | 101 | "source": [ |
106 | 102 | "# Default start time to 09:00\n", |
107 | | - "source[\"Start Time\"] = pd.to_timedelta(\"09:00:00\")\n", |
108 | | - "source.dtypes" |
| 103 | + "source[\"Start Time\"] = pd.to_timedelta(\"09:00:00\")" |
109 | 104 | ] |
110 | 105 | }, |
111 | 106 | { |
|
0 commit comments