0

Data science

n, p = [int(x) for x in input().split()] I’m trying to do the first project from the data science course. I do not fully understand it, can someone help me with it?

6th Apr 2021, 5:19 PM
Usman Jega
Usman Jega - avatar
7 Antworten
+ 2
[int(x) for x in input().split()] construction create from string example "2 3", list of integer values [2,3] and n, p = [2,3] equal n = 2, p = 3
7th Apr 2021, 8:54 AM
Илья Мирошник
Илья Мирошник - avatar
+ 1
[int(x) for x in input().split()] This generation equal GeneratedList = [] for x in input().split(): GeneratedList.append(int(x))
7th Apr 2021, 8:57 AM
Илья Мирошник
Илья Мирошник - avatar
+ 1
thank you so much😊
7th Apr 2021, 11:12 AM
Usman Jega
Usman Jega - avatar
0
What interesting u?
7th Apr 2021, 7:51 AM
Илья Мирошник
Илья Мирошник - avatar
0
input().split() Its obviously split inputed string in list by spaces(default)
7th Apr 2021, 8:58 AM
Илья Мирошник
Илья Мирошник - avatar
0
It looks like you're trying to parse two integers, n, and p, from input in Python. Here's a concise way to do it: n, p = map(int, input().split()) This line will read a single line of input, split it by spaces, and convert the parts to integers, assigning them to n and p. If you have further questions about how to use n and p in your data science tasks, feel free to ask!
7th Oct 2024, 5:59 AM
khushnuma
khushnuma - avatar
0
Step a: What usually is the first project? Most beginner data science projects are about: Taking some data (maybe numbers, CSV, or text). Cleaning it (fix missing values, remove errors). Doing simple analysis (like averages, counts, or trends). Showing results (with graphs or tables). Step b: Your given code is about cleaning data You enter numbers like: 10 20 nan 30 It changes "nan" into a missing value. Then it fills the missing value with the average of other numbers. Finally, it shows the cleaned list. This is called data preprocessing (very common in real data projects). Step 3: What you need to do Don’t try to understand everything at once. Just remember: we clean data before analysis. This project is teaching you how to handle missing values (NaN), which is one of the first steps in data science.
26th Aug 2025, 2:04 PM
Mayank kumar Verma
Mayank kumar Verma - avatar