#๐Ÿ”’ How do i stop my code from printing a list of Falses

9 messages ยท Page 1 of 1 (latest)

burnt heartBOT
#

Hey @fringe sleet!

It looks like you're trying to paste code into this channel.

Discord has support for Markdown, which allows you to post code with full syntax highlighting. Please use these whenever you paste code, as this helps improve the legibility and makes it easier for us to help you.

To do this, use the following method:
```py
print('Hello, world!')
```

This will result in the following:

print('Hello, world!')```
You can **edit your original message** to correct your code block.
#

@fringe sleet

Python help channel opened

Remember to:

  • Ask your Python question, not if you can ask or if there's an expert who can help.
  • Show a code sample as text (rather than a screenshot) and the error message, if you've got one.
  • Explain what you expect to happen and what actually happens.

:warning: Do not pip install anything that isn't related to your question, especially if asked to over DMs.

meager kettle
#

Please format your code according to the bot message.

fringe sleet
#

'''py
import pandas as pd
path = "C:/Users/Book1.csv"

pandas logic and file name

class vehichle:
def init(self,data):
self.data = pd.read_csv(path)

class specifc (vehichle):
def init(self,data):
super().init(data)

def car_list(self,make,model,year):    
    car_list = self.data[self.data['Make'] == make , self.data["Model"] == model , self.data[self.data["Model Year"] == year]]

the ".empty" condition checks for the condition of car_list and see if the requested info is there or it is empty

    if not car_list.empty:
        # Print the depreciation start and 5 year rate
        print("The Depreciation start and 5 year rate is:\n", car_list[["Depreciation Start", "5 YR Depreciation Rate (%)"]])
    else:
        # Print a message if no car is found
        print("No car found matching the specified criteria.")

data_for_car = pd.read_csv(path)

in_specific = specifc(data_for_car)

result = in_specific.car_list("Tesla", "Model 3", 2020)

print(result)
'''

burnt heartBOT
#

Hey @fringe sleet!

It looks like you are trying to paste code into this channel.

You seem to be using the wrong symbols to indicate where the code block should start. The correct symbols would be ```, not '''.

Here is an example of how it should look:
```py
print('Hello, world!')
```

This will result in the following:

print('Hello, world!')```
You can **edit your original message** to correct your code block.
fringe sleet
#
import pandas as pd
path = "C:/Book1.csv"



 #file name
class vehichle:
    def __init__(self,data):
        self.data = pd.read_csv(path)



class specifc (vehichle):
    def __init__(self,data):
        super().__init__(data)

    def car_list(self,make,model,year):    
        car_list = self.data[self.data['Make'] == make , self.data["Model"] == model , self.data[self.data["Model Year"] == year]]


# the ".empty" condition checks for the condition of car_list and see if the requested info is there or it is empty
        if not car_list.empty:
            # Print the depreciation start and 5 year rate
            print("The Depreciation start and 5 year rate is:\n", car_list[["Depreciation Start", "5 YR Depreciation Rate (%)"]])
        else:
            # Print a message if no car is found
            print("No car found matching the specified criteria.")


data_for_car = pd.read_csv(path)

in_specific = specifc(data_for_car)


result = in_specific.car_list("Tesla", "Model 3", 2020)


print(result)



burnt heartBOT
#
Python help channel closed

This help channel has been closed and it's no longer possible to send messages here. If your question wasn't answered, feel free to create a new post in #1035199133436354600. To maximize your chances of getting a response, check out this guide on asking good questions.

#

๐Ÿ”’ How do i stop my code from printing a list of Falses