Informatics2-2021/Lab10

A MathWikiből
(Változatok közti eltérés)
(write_csv)
(Exercise)
12. sor: 12. sor:
 
  In the second line, write which area of mathematics interests you the most.
 
  In the second line, write which area of mathematics interests you the most.
 
  And the third line is what you would like to work on in the future (several things can be listed).
 
  And the third line is what you would like to work on in the future (several things can be listed).
 +
 +
==read_csv==
 +
Write a function that reads a .csv file.<br>
 +
The function should have an optional delimiter parameter with a default value of ','.<br>
 +
Write that the function works even if the values in the file are not separated by ',' but by tabs. (In this case, the input delimiter = '\ t' also indicates this, it does not need to be detected automatically.)<br>
 +
The function returns a list of lists in which the lists correspond to the rows and the elements are the words in the row separated accordingly.

A lap 2021. április 21., 10:38-kori változata

Home

Exercise

write_csv

Write the first.csv and second.csv files based on what you learned in the lecture.

In the first.csv:

enter your first and last names separated by a comma in the first line. 
In the second line, separate the title of your favorite movie with a comma, when it was made and the name of the actor and the director from the movie.

In the second.csv:

Enter your last names and first names with a tab in the first line.
In the second line, write which area of mathematics interests you the most.
And the third line is what you would like to work on in the future (several things can be listed).

read_csv

Write a function that reads a .csv file.
The function should have an optional delimiter parameter with a default value of ','.
Write that the function works even if the values in the file are not separated by ',' but by tabs. (In this case, the input delimiter = '\ t' also indicates this, it does not need to be detected automatically.)
The function returns a list of lists in which the lists correspond to the rows and the elements are the words in the row separated accordingly.

Személyes eszközök