df2 loan balance, I want to keep two decimal places when summing, but the result is invalid, how to solve it?

Click “Python Crawler and Data Mining” above to follow

Reply “Books” to receive a total of 10 Python e-books from entry to advanced

now

day

chicken

Soup

When the window is tidying up one’s hair, the mirror is covered with yellow flowers.

Hello everyone, I am Pippi.

1. Foreword

A few days ago, I asked a question about Pandas data processing in the exchange group of the strongest Python king [Bin]. Let’s take a look.

Could you please help me take another look: df2 loan balance, I want to keep two decimal places when summing, but the result is invalid.

Is it because of the second line?

449251116114219cf5d2418c6df346a5.jpeg

2. Implementation process

Fans checked here and found that the loan balance is float64. Even after removing the second line, two decimal places still cannot be retained.

Later, [Don’t be angry] gave an idea, as follows:

import pandas as pd

df = pd.read_excel('test_data.xlsx')
df1 = (df.groupby('Borrower')['Loan Balance'].sum())/100000
print(df1)

712a10ac31c2204b69333bde0fef1ae2.png

The fan’s problem was successfully solved.

[Book Donation Activity 1]

ChatGPT Advanced: Getting Started with Tips Project

BROKE, the original prompt word design framework that has exploded on the Internet, will take you to master the art of asking questions to artificial intelligence in 5 steps. From a novice to a ChatGPT application expert, you can transform AI into a production tool and reshape your workflow!

Introduction

This book is a toolkit for everyone, designed to help you master and effectively utilize AI tools represented by ChatGPT. After studying this book, you will be able to freely use ChatGPT in life and professional fields and become an advanced ChatGPT player.

This book is divided into 9 chapters, covering three levels: introduction and interpretation, introductory learning, and advanced improvement. Chapters 1 to 2 provide an in-depth introduction and analysis of ChatGPT and prompt engineering, and explore the prompt engineering discipline from multiple disciplines. Chapters 3 to 5 demonstrate the practical application of ChatGPT, teach you how to use ChatGPT to solve natural language processing problems, and provide you with a set of operable and repeatable prompt design frameworks so that you can master ChatGPT proficiently. Chapters 6 to 9 explain prompt engineering methods from academia and how to innovate around ChatGPT; in addition, they provide practical reference materials for readers who want to develop applications with ChatGPT, and introduce other options besides ChatGPT.

This book focuses on the practical application of ChatGPT, which is operable, repeatable, and easy to read without losing depth. Whether you are curious about ChatGPT and similar tools, or looking forward to turning them into productivity, this book is worth reading. In addition, this book can also be used as a teaching material for relevant training institutions.

7a8fcb07aa84693c36a62b4979c75aa2.jpeg

[Book Donation Activity 2]

Easily play with machine learning and deep learning with ChatGPT

Break through the constraints of traditional learning and unlock the infinite possibilities of AI with the magical power of ChatGPT!

One sentence recommendation

Use ChatGPT to break through the constraints of traditional learning and unlock unlimited possibilities for AI!

Introduction

As machine learning and deep learning technologies continue to develop and advance, so do their complexity. For beginners, learning these two fields may encounter many difficulties and challenges, such as lack of theoretical knowledge, difficulties in data processing, uncertainty in algorithm selection, etc. At this time, ChatGPT can provide powerful help. Using ChatGPT, readers can more easily understand the concepts and techniques of machine learning and deep learning, and solve various problems and doubts encountered during the learning process. In addition, ChatGPT can also provide readers with more practical experiences and skills to help them better master the basic principles and methods of machine learning and deep learning. The main contents of this book include exploratory data analysis, supervised learning (linear regression, SVM, decision tree, etc.), unsupervised learning (dimensionality reduction, clustering, etc.), as well as the basic principles and applications of deep learning.

This book aims to provide readers with a systematic, comprehensive and easy-to-understand introductory tutorial on machine learning and deep learning. No extensive mathematical background is required, just basic programming knowledge to get started easily.

fac988683ec337d4df9e7fb68dfc0b61.jpeg

3. Summary

Hello everyone, I am Pippi. This article mainly takes stock of a Pandas data processing problem. In response to this problem, the article provides specific analysis and code implementation to help fans successfully solve the problem.

Finally, I would like to thank fan [Bin] for asking questions, [Black Technology·Drum Bag] and [Mo Angry] for their ideas and code analysis, and [Lazy Man Thinking] and others for participating in learning and exchanges.

[Question supplement] Warm reminder, when everyone asks questions in the group. You can pay attention to the following points: If it involves large file data, you can desensitize the data, send some demo data (meaning small files), and then paste some code (the kind that can be copied), and remember to send screenshots of errors (complete screenshots) ). If there is not much code, just send the code text directly. If the code exceeds 50 lines, just send a .py file.

1c056103688c6d02a7965c7802e5a79a.png

If you encounter problems during the learning process, please feel free to contact me to solve them (my WeChat: pdcfighting1). At the request of fans, I created some ChatGPT robot communication groups and high-quality Python paid learning communication groups and paid order-taking groups. , welcome everyone to join my Python learning exchange group and order-taking group!

4f2c54108257f3d5dc85005e12d76ed1.png

Friends, try it out quickly! If you encounter any problems during the learning process, you are welcome to add me as a friend, and I will bring you into the Python learning exchange group to discuss and learn together.

1d47529691b8450cb2949b9ee12f6f85.jpeg

< /strong>—— –< /strong> End < /strong>

Recommended articles from past issues:

  • if a and b and c and d: Is there an elegant way to write this code?

  • What is the relationship between Pycharm and Python?

  • They all say that chatGPT programming is so powerful. I tried it today. There is a static web page, but chatGPT actually failed to handle it?

  • If you can’t stand still, prepare to increase your position. How should you write this pandas statement?

6409eec2c400ff12183cfb1ca12c7d4f.png

Everyone is welcome to like,leave a message,retweet, reprint,Thank you for your company and support.

If you want to join the Python learning group, please reply [Join the group] in the background

Love is always there in thousands of rivers and mountains, can you click [Looking]

/Today’s Message Topic/

Just say a word or two~~