Creator of pyfpa python package. Finance Person who uses a lot of python, ML, RPA and pandas. I want to teach people how to get useful in python quickly.
If you need to make a mid-function/line comment:
columns = 'Region'
pd.pivot_table(data, 'Sales', 'Month',
#columns,
aggfunc=mean())
Uncommenting the middle line allows you to add columns to the pivot table.
#Python
To walk through a directory and subdirectory:
import os
d = os.walk(DIRECTORYPATH)
"d' is now a generator you can cycle through the root and each subdirectory:
for x in d:
next(d)
#Python#pythonlearning#datascience
Was looking for a way to include size of each segment in groupby with pandas.
Ended up doing this
df["size"] = 1
df.groupby(["device"]).agg({
"pos_wow_change": np.mean,
"size": sum,
})
What's the better way? #python
Nested List transposition using list comprehension.
m = [[1,2,3],[10,20,30],[100,200,300]]
z = [[m[m.index(x)][y] for x in m] for y in [m.index(x) for x in m]]
z output = [[1, 10, 100], [2, 20, 200], [3, 30, 300]]
#LearnPython#Python
This is SO true! Especially in corporate there is a huge amount of work in wrangling data and just mapping business processes.
Its like when Bill Gates set out to save the world with Tech and the internet and found out it really needed toilets, fresh water and mosquito nets.
I think this story on GPT-3 takes a little too much comfort in ways the system remains imperfect when the key fact is it’s getting better, at more and more varied tasks than anyone predicted, at astonishing speed. nytimes.com/2020/11/24/scien…
The chip was designed for compatibility with 16K-bit chips. Long dark strips in photo are four 64×256 memory arrays. This design made it compatible with existing refresh circuits like the Z-80. (Bits in DRAM capacitors leak away unless they are refreshed every few milliseconds.)