I have been using the text expander multiple selection almost like a menu, I think is more dynamic and faster to create than actual shortcut menu. I like that it can be created in 1 text screen I wish you could expand this functionality to be able to create a text expander multi level menu . One problem I have is when the multiple options are too many, the selection popup or menu becomes too large that it exceeds the screen and there is no scroll bar to scroll to the end. I think is worth expanding this functionality, either to group multiple selections into submenus right in the text expander window, I feel this is more dynamic than using the shortcut menu functionality since you need 1 item (text expander,macro, etc) per menu line.
I could group them myself by creating new text expanders with multioptions calling parts of the options below, but I wish it could all be done withing the same text expander window.
This is an example of what I was trying to do, almost to create a pandas tool tip cheatsheet
----------IMPORT------------::
/import pandas import library example import pandas as pd::import pandas as pd
/----------LOAD & SAVE------------::
/read csv load csv example pd.read_csv("file.csv")::pd.read_csv("file.csv")
/read excel load excel example pd.read_excel("file.xlsx")::pd.read_excel("file.xlsx")
/to csv save csv example df.to_csv("file.csv", index=False)::df.to_csv("file.csv", index=False)
/to excel save excel example df.to_excel("file.xlsx", index=False)::df.to_excel("file.xlsx", index=False)
/----------INSPECT------------::
/head first rows example df.head()::df.head()
/tail last rows example df.tail()::df.tail()
/sample random rows example df.sample(5)::df.sample(5)
/info structure info example df.info()::df.info()
/describe summary stats example df.describe()::df.describe()
/shape rows cols example df.shape::df.shape
/columns column names example df.columns::df.columns
/dtypes data types example df.dtypes::df.dtypes
/index show index example df.index::df.index
/----------SELECT------------::
/col select column example df["col"]::df["col"]
/cols select columns example df[["col1","col2"]]::df[["col1","col2"]]
/loc label selection example df.loc[0:4,"col"]::df.loc[0:4,"col"]
/iloc position selection example df.iloc[0:5,0:2]::df.iloc[0:5,0:2]
/at single label value example df.at[0,"col"]::df.at[0,"col"]
/iat single position value example df.iat[0,0]::df.iat[0,0]
/----------FILTER------------::
/bool filter basic filter example df[df["col"] > 5]::df[df["col"] > 5]
/query filter rows example df.query("col > 5")::df.query("col > 5")
/isin in list example df["col"].isin([1,2,3])::df["col"].isin([1,2,3])
/~isin not in list example ~df["col"].isin([1,2,3])::~df["col"].isin([1,2,3])
/between range filter example df["col"].between(1,10)::df["col"].between(1,10)
/isna null check example df["col"].isna()::df["col"].isna()
/notna not null example df["col"].notna()::df["col"].notna()
/----------SORT------------::
/sort values sort rows example df.sort_values("col")::df.sort_values("col")
/sort desc descending sort example df.sort_values("col", ascending=False)::df.sort_values("col", ascending=False)
/sort index sort index example df.sort_index()::df.sort_index()
/----------CLEAN------------::
/dropna remove nulls example df.dropna()::df.dropna()
/fillna fill nulls example df["col"].fillna(0)::df["col"].fillna(0)
/replace replace values example df["col"].replace("A","B")::df["col"].replace("A","B")
/astype change type example df["col"].astype(int)::df["col"].astype(int)
/drop col drop columns example df.drop(columns=["col"])::df.drop(columns=["col"])
/drop row drop rows example df.drop(index=[0,1])::df.drop(index=[0,1])
/rename rename columns example df.rename(columns={"old":"new"})::df.rename(columns={"old":"new"})
/drop dupes remove duplicates example df.drop_duplicates()::df.drop_duplicates()
/reset index reset index example df.reset_index(drop=True)::df.reset_index(drop=True)
/set index make column index example df.set_index("col")::df.set_index("col")
/----------COLUMN OPS------------::
/new col create column example df["new"] = df["a"] + df["b"]::df["new"] = df["a"] + df["b"]
/map map values example df["col"].map({"A":1,"B":2})::df["col"].map({"A":1,"B":2})
/apply apply function example df["col"].apply(lambda x: x*2)::df["col"].apply(lambda x: x*2)
/str lower lowercase text example df["col"].str.lower()::df["col"].str.lower()
/str contains contains text example df["col"].str.contains("abc")::df["col"].str.contains("abc")
/str replace replace text example df["col"].str.replace("a","b")::df["col"].str.replace("a","b")
/----------COUNT & UNIQUE------------::
/count non-null count example df["col"].count()::df["col"].count()
/size total size example df["col"].size::df["col"].size
/nunique unique count example df["col"].nunique()::df["col"].nunique()
/unique unique values example df["col"].unique()::df["col"].unique()
/value counts frequency count example df["col"].value_counts()::df["col"].value_counts()
/----------MATH & STATS------------::
/sum total example df["col"].sum()::df["col"].sum()
/mean average example df["col"].mean()::df["col"].mean()
/median middle value example df["col"].median()::df["col"].median()
/min smallest example df["col"].min()::df["col"].min()
/max largest example df["col"].max()::df["col"].max()
/std std dev example df["col"].std()::df["col"].std()
/var variance example df["col"].var()::df["col"].var()
/idxmin index of min example df["col"].idxmin()::df["col"].idxmin()
/idxmax index of max example df["col"].idxmax()::df["col"].idxmax()
/----------AGGREGATE------------::
/agg one one agg op example df["col"].agg("sum")::df["col"].agg("sum")
/agg many many agg ops example df["col"].agg(["min","max","mean"])::df["col"].agg(["min","max","mean"])
/agg dict per-column agg example df.agg({"a":"sum","b":"mean"})::df.agg({"a":"sum","b":"mean"})
/----------GROUPBY------------::
/groupby group rows example df.groupby("col")::df.groupby("col")
/group sum grouped sum example df.groupby("group")["val"].sum()::df.groupby("group")["val"].sum()
/group mean grouped mean example df.groupby("group")["val"].mean()::df.groupby("group")["val"].mean()
/group count grouped count example df.groupby("group")["val"].count()::df.groupby("group")["val"].count()
/group agg grouped agg example df.groupby("group").agg({"val":["sum","mean"]})::df.groupby("group").agg({"val":["sum","mean"]})
/----------RESHAPE------------::
/sort cols reorder columns example df[["col3","col1","col2"]]::df[["col3","col1","col2"]]
/transpose swap rows cols example df.T::df.T
/melt wide to long example df.melt()::df.melt()
/pivot reshape table example df.pivot(index="id", columns="type", values="val")::df.pivot(index="id", columns="type", values="val")
/pivot table grouped pivot example df.pivot_table(index="id", values="val", aggfunc="sum")::df.pivot_table(index="id", values="val", aggfunc="sum")
/----------COMBINE------------::
/merge join dataframes example df1.merge(df2, on="id")::df1.merge(df2, on="id")
/merge left left join example df1.merge(df2, on="id", how="left")::df1.merge(df2, on="id", how="left")
/concat rows stack rows example pd.concat([df1,df2])::pd.concat([df1,df2])
/concat cols stack columns example pd.concat([df1,df2], axis=1)::pd.concat([df1,df2], axis=1)
/----------INDEXING------------::
/index col use index in filter example df[df.index > 5]::df[df.index > 5]
/index name rename index example df.index.name = "id"::df.index.name = "id"
/----------DISPLAY------------::
/max cols show all cols example pd.set_option("display.max_columns", None)::pd.set_option("display.max_columns", None)
/max rows show all rows example pd.set_option("display.max_rows", None)::pd.set_option("display.max_rows", None)
/max width wider display example pd.set_option("display.width", None)::pd.set_option("display.width", None)
/max colwidth show full text example pd.set_option("display.max_colwidth", None)::pd.set_option("display.max_colwidth", None)
text expander multiple selection "menu"
-
mr9bitbyte
- Posts: 42
- Joined: Apr 25th, ’23, 17:20
Thanks, interesting ideas. We’ll see if the functionality of multiple selections feature could be expanded. 
