#๐Ÿ”’ python homework

52 messages ยท Page 1 of 1 (latest)

safe ivy
#

helo my homework is to organise a csv file and one question is like ignore the heading in this is the heading 1 row or 3 rows?

tulip coralBOT
#

@safe ivy

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.

outer meteor
safe ivy
#

this

outer meteor
#

I recall you've gotten it to append to the new list

safe ivy
#

oh like everything

#

im onto the 2nd question though

outer meteor
#

alright

#

btw

#

make sure to share your code as text next time

safe ivy
#

wat do u mean

tulip coralBOT
#
Formatting code on Discord

Here's how to format Python code on Discord:

```py
print('Hello world!')
```

These are backticks, not quotes. Check this out if you can't find the backtick key.

For long code samples, you can use our pastebin.

safe ivy
#
print('Hello world!')
#

wow cool

outer meteor
#

It helps us see the code better than from a screenshot

safe ivy
#

wait its not letting me send it tho

outer meteor
#

And also easy to point out where the mistake is

outer meteor
safe ivy
#

like i press enter

#

and it just makes a new line

#

im sending my code

#
print('Hello world!')
outer meteor
#
print("like")
print("this?")
safe ivy
#
def process_data(data):
    selected_data = []

    num_rows = len(data)
#

ohh

outer meteor
#

anyways

#

what are you stuck on?

safe ivy
#

and my hw tells me to ignore the header

#

is that 3 rows or 1 row

outer meteor
#

right so just skip the first row

safe ivy
#

burt like is dat 3 rows or 1 row..

outer meteor
#

Its typically 1 row

#

If you print the row after reading the file, what does it show?

glossy oracle
#

... unless it came out of a spreadsheet, which sometimes has more rows of guff before the data.

But yes, show the first few rows of the data, see what's there.

safe ivy
#

oki

#

python is kind of hard :C

glossy oracle
#

programming requires precision, largely because you need to tell a computer exactly what to do. This gets easier.

safe ivy
#

i wish my dad forced me to learn it when i was 4

outer meteor
#

If I had to learn it when I was 4, I wouldn't get it at all. Earliest I started learning how to program was when I was 13.

safe ivy
#

its so much to remember

#

i wished someone forced me to learn it when i was 13

#

ididnt know i had to do this stuff even when im studying engineering

outer meteor
#

Its fine. It takes time to get used to do this

safe ivy
#

if i knew i would have probably studied finance instead

safe ivy
outer meteor
#

IIRC Roblox does a lot of Lua stuff. But whatever you learn in Python is easily transferable to other programming languages like Lua

glossy oracle
#

try printing the first 5 rows of data:

for i in range(5):
    print(i, data[i])
tulip coralBOT
#
Python help channel closed for inactivity

This help channel has been closed. 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.