Logo

DSC 10 Discussion - Shared screen with speaker view
Amol Khanna
25:50
scatter?
Huy Trinh
25:53
Scatter
MUCHAN (SAM) LI
32:56
Wait so for a histogram, the x is automatically defaulted as the frequency?
MUCHAN (SAM) LI
35:53
thanks
Carlos Ricco
36:05
u just label the y-axis for density.
Huy Trinh
36:55
calfire.groupby('cause').count().sort_values(by='county').plot(kind='barh',y='county')
MUCHAN (SAM) LI
46:03
Does the plot got overwritten if we code it separately
Carlos Ricco
46:04
we can make two tables, for natural and human-caused, then make a DF assigning these 2, then plot without mention x and y, so we will get 2 lines.
Carlos Ricco
46:42
clean the data dropping 'unkown'...
Huy Trinh
53:30
Is there anyway that you can assign 0 in those missing years?
MUCHAN (SAM) LI
55:33
Did we exclude unknown causes?
MUCHAN (SAM) LI
56:03
Oh I see
Carlos Ricco
57:42
split()[2]
Carlos Ricco
01:00:01
then assign to the other table and drop the old column
Huy Trinh
01:00:45
split('-')
Carlos Ricco
01:00:58
you could split('- )
Carlos Ricco
01:01:45
split with dash and space
Carlos Ricco
01:04:09
can I use swtich?
Carlos Ricco
01:04:18
ups, switch?
Carlos Ricco
01:04:41
or if statement...
Justin Eldridge
01:05:06
there's no "switch" in Python, unfortunately. if would work, but we haven't learned it yet, so there might be another way
MUCHAN (SAM) LI
01:05:12
Sounds like MATLAB
Carlos Ricco
01:06:11
oh ,I see -> names[m]
Carlos Ricco
01:06:33
names - 1
MUCHAN (SAM) LI
01:07:37
m+1
MUCHAN (SAM) LI
01:07:52
-1 my bad
Carlos Ricco
01:09:01
It's better inside the function
Justin Eldridge
01:10:04
@carlos Usually! But sometimes you'll already have a list of month names defined somewhere else, and it's better not to re-type it. In such cases its best to UPPERCASE your variable names so that you know they are "global constants".
Carlos Ricco
01:10:29
It's true. Good point
Carlos Ricco
01:11:04
I meant just if we need to create an array for that, but having already somewhere else we don't need it.
MUCHAN (SAM) LI
01:16:23
Should we apply abs to lat and long
MUCHAN (SAM) LI
01:17:23
Oh I see, I though the long in the table might have some positive values
Huy Trinh
01:20:36
Thank you
Betty Gong
01:20:37
Thank you
MUCHAN (SAM) LI
01:20:44
Thank you