#π school work clueless
48 messages Β· Page 1 of 1 (latest)
@signal rapids
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.
Just ask here please
You'll get more help if you can share it here
ok
give me sec i will sned
@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
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.
In particular, if you can share only the most relevant part where you're having a problem, we can help better
ya right this is hard but not imposiible
i am in Office so can you give me
where you stuck?
i dont even where to start
what is main python programmm you want ?
my group aslo
Are you not working in a group?
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
is this all of the assignment?
ya
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.
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.
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?
3
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
i got no clue about it this module started this month they havent thought us anything
https://realpython.com/python-csv/ start there
Ok thx
!d csv.DictReader (if you click on the blue text below, that's the official doc)
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.
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.