Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Comprehension completed marco #25

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

marcoayora
Copy link

No description provided.

@bripollc
Copy link

Hola Marco,

Supeeer lab. Felicidades! ✨Te dejo solo un par de despistes:

  • Add a condition to the list comprehension above so that the last value in each subarray is printed, but only if it is less than or equal to 0.5.
list_subarray = [fo[-1] for xy in b for fo in xy if fo[-1] <= 0.5]
print(list_subarray)

Te pide que imprimas el último valor de cada subarray si su valor es inferior o igual a 0.5. En tu código estas imprimiendo todos los valores que cumplen esa condición independientemente de su posición en la subarray ya que, en ningún momento, estas especificando que compruebe únicamente el último valor. La manera de seleccionar el último valor sería usando fo[2] o fo[-1], sin necesidad de hacer una comparación.

  • Use a list comprehension to select and print the names of all CSV files in the /data directory. Mind slashes.
directory = ("../data")
file_lst = [i for i in os.listdir(directory) if i.endswith("csv")]
print(file_lst)

Te dejo la solución del último ejercicio:)

Ps: tip! Si imprimes tus listas usando print() la legibilidad del documento será más cómodo 😶‍🌫️

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants