From 50ca17cf621a2c166a6458ccefbe042fa2b581de Mon Sep 17 00:00:00 2001 From: deveshbervar Date: Sat, 4 Jan 2025 20:20:08 +0530 Subject: [PATCH] Added improvements to the cheat sheet based on issue #40680 --- doc/path/to/cheat_sheet.rst | 9 +++++++++ 1 file changed, 9 insertions(+) create mode 100644 doc/path/to/cheat_sheet.rst diff --git a/doc/path/to/cheat_sheet.rst b/doc/path/to/cheat_sheet.rst new file mode 100644 index 0000000000000..83e13fc5cab5e --- /dev/null +++ b/doc/path/to/cheat_sheet.rst @@ -0,0 +1,9 @@ +df = pd.DataFrame({'A': [1, 2, 3], 'B': [4, 5, 6]}) +df.plot(kind='bar') +pd.set_option('display.max_rows', 10) # Display up to 10 rows +# Read CSV +df = pd.read_csv('data.csv') +# Write to Excel +df.to_excel('output.xlsx', index=False) +df['A_squared'] = df['A'].apply(lambda x: x**2) +s = pd.Series([1, 2, pd.NA], dtype="Int64")