19 Matching Annotations
- Dec 2021
- Nov 2021
-
www.tensorflow.org www.tensorflow.org
-
date_time = pd.to_datetime(df.pop('Date Time'), format='%d.%m.%Y %H:%M:%S')
-
df.describe().transpose()
Tags
Annotators
URL
-
- Sep 2021
- Aug 2020
-
nextjournal.com nextjournal.com
- Mar 2020
-
-
It’s just that it often makes sense to write code in the order JOIN / WHERE / GROUP BY / HAVING. (I’ll often put a WHERE first to improve performance though, and I think most database engines will also do a WHERE first in practice)
Pandas usually writes code in this syntax:
JOIN
WHERE
GROUP BY
HAVING
Example:
df = thing1.join(thing2) # like a JOIN
df = df[df.created_at > 1000] # like a WHERE
df = df.groupby('something', num_yes = ('yes', 'sum')) # like a GROUP BY
df = df[df.num_yes > 2] # like a HAVING, filtering on the result of a GROUP BY
df = df[['num_yes', 'something1', 'something']] # pick the columns I want to display, like a SELECT
df.sort_values('sometthing', ascending=True)[:30] # ORDER BY and LIMIT
df[:30]
-
- Nov 2019
-
github.com github.com
Tags
Annotators
URL
-
- Oct 2019
-
pandas.pydata.org pandas.pydata.org
-
Indicate number of NA values placed in non-numeric columns.
This is only true when using the Python parsing engine.
Filled 3 NA values in column name
If using the C parsing engine you get something like the following output:
Tokenization took: 0.01 ms Type conversion took: 0.70 ms Parser memory cleanup took: 0.01 ms
-
- Feb 2019
-
stackoverflow.com stackoverflow.com
-
Efficient way to loop over Pandas Dataframe to make dummy variables (1 or 0 input)
dummy encoding
-
- Jan 2019
-
www.learndatasci.com www.learndatasci.com
-
Measurements are variables that can be quantified. All data in the output above are measurements. Some of these measurements, such as state_percentile_16, avg_score_16 and school_rating, are outcomes; these outcomes cannot be used to explain one another. For example, explaining school_rating as a result of state_percentile_16 (test scores) is circular logic. Therefore we need a second class of variables.
-
-
hypothes.is hypothes.is
-
nning. It's time to start annotating som
sfsdf
-
- Jun 2018
-
stackoverflow.com stackoverflow.com
-
if you need to pull out these rows and examine them
-
- May 2018
- Apr 2018
-
geopandas.org geopandas.org
-
GeoPandas
Tags
Annotators
URL
-
- Mar 2018
-
simplistic.me simplistic.me
-
I'll skip the inefficient method I used before with the custom groupby aggregationm, and go for some neat trick using the mighty transform method.
a more constrained. and thus more efficient way to do transformations on groupbys than the apply method. You can do very cool stuff with it. For those of you who know splunk - this has the neat "streamstats" and "eventstats" capabilities
-
- Dec 2017
-
tomaugspurger.github.io tomaugspurger.github.io
-
gs.resample("5d").mean().head()
Tags
Annotators
URL
-
-
-
df['n_votes'] = df.n_votes.astype(int, errors='ignore')
-
ax = df['color'].value_counts().plot('bar')
Tags
Annotators
URL
-