#πŸ”’ school work clueless

48 messages Β· Page 1 of 1 (latest)

signal rapids
#

i need help in my school project anyone can help pls dm me my teachers and friends are not helping if can help pls dm me

glass vortexBOT
#

@signal rapids

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.

velvet crane
#

You'll get more help if you can share it here

signal rapids
#

ok

tidal hatch
#

What is your project?

#

@signal rapids

signal rapids
#

give me sec i will sned

velvet crane
#

@signal rapids you can't share files here except for pictures and videos. If you have code, you can share it in a pastebin

#

!pastebin

glass vortexBOT
#
Pasting large amounts of code

If your code is too long to fit in a codeblock in Discord, you can paste your code here:
https://paste.pythondiscord.com/

After pasting your code, save it by clicking the Paste! button in the bottom left, or by pressing CTRL + S. After doing that, you will be navigated to the new paste's page. Copy the URL and post it here so others can see it.

velvet crane
#

In particular, if you can share only the most relevant part where you're having a problem, we can help better

signal rapids
#

they never even tell what software to use

#

or i am just dumb

tidal hatch
#

ya right this is hard but not imposiible

#

i am in Office so can you give me

#

where you stuck?

signal rapids
#

i dont even where to start

tidal hatch
#

what is main python programmm you want ?

signal rapids
#

my group aslo

velvet crane
signal rapids
#

we are they are more clueless than me

#

they all not doing anything

#

not even trying only i am trying and my teachers are not helping at all

velvet crane
signal rapids
#

ya

velvet crane
#

Kinda limited but

#

doable

#

!d csv to open the csv file and read through it

glass vortexBOT
#
csv

Source code: Lib/csv.py

The so-called CSV (Comma Separated Values) format is the most common import and export format for spreadsheets and databases. CSV format was used for many years prior to attempts to describe the format in a standardized way in RFC 4180. The lack of a well-defined standard means that subtle differences often exist in the data produced and consumed by different applications. These differences can make it annoying to process CSV files from multiple sources. Still, while the delimiters and quoting characters vary, the overall format is similar enough that it is possible to write a single module which can efficiently manipulate such data, hiding the details of reading and writing the data from the programmer.

velvet crane
#

If the csv has named columns use the DictReader

#

!d csv.DictReader

glass vortexBOT
#

class csv.DictReader(f, fieldnames=None, restkey=None, restval=None, dialect='excel', *args, **kwds)```
Create an object that operates like a regular reader but maps the information in each row to a [`dict`](https://docs.python.org/3/library/stdtypes.html#dict) whose keys are given by the optional *fieldnames* parameter.

The *fieldnames* parameter is a [sequence](https://docs.python.org/3/glossary.html#term-sequence). If *fieldnames* is omitted, the values in the first row of file *f* will be used as the fieldnames and will be omitted from the results. If *fieldnames* is provided, they will be used and the first row will be included in the results. Regardless of how the fieldnames are determined, the dictionary preserves their original ordering.
velvet crane
#

And then loop through the CSV reads and put it in lists (or list of lists if you can handle it)

#

It did say you can't have dictionaries or tuples

#

Are you in a group of 2 or 3?

signal rapids
#

3

velvet crane
#

Maybe 1 person to make the menu function

#

1 person to handle the CSV read and parsing function

#

1 person to handle the presentation of the parsed csv data

signal rapids
#

i got no clue about it this module started this month they havent thought us anything

velvet crane
signal rapids
#

Ok thx

velvet crane
#

!d csv.DictReader (if you click on the blue text below, that's the official doc)

glass vortexBOT
#

class csv.DictReader(f, fieldnames=None, restkey=None, restval=None, dialect='excel', *args, **kwds)```
Create an object that operates like a regular reader but maps the information in each row to a [`dict`](https://docs.python.org/3/library/stdtypes.html#dict) whose keys are given by the optional *fieldnames* parameter.

The *fieldnames* parameter is a [sequence](https://docs.python.org/3/glossary.html#term-sequence). If *fieldnames* is omitted, the values in the first row of file *f* will be used as the fieldnames and will be omitted from the results. If *fieldnames* is provided, they will be used and the first row will be included in the results. Regardless of how the fieldnames are determined, the dictionary preserves their original ordering.
glass vortexBOT
#
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.