Data Analysis with Python explained simply.
- What is Data Analysis?
- What does Data Analysis look like?
- How do I get the last n rows of a DataFrame?
- How do I get the rows of a DataFrame starting from row i to j?
- How do I add multiple columns to a DataFrame simultaneously?
- How do I create a 1d array?
- How do I create a 2d array?
- How do I create a 1d array of random numbers from 0 to 1?
- How do I perform operations on all the values of an array?
- How do I get the nth column or row of data in an array?
df.tail(10)
df.iloc[i:j]
df.assign(
**{
'newcol_1': 'some default',
'newcol_2': 'some default',
'newcol_3': 'some default',
}
)
Create the dict above programmatically.
np.array([1,2,3,4,5])
np.arange(0,10)
np.array([1,2,3,4,5],[6,7,8,9,10])
np.arange(0,10)
np.random.rand(10) # generates a 1d array of 10 elements
arr + 5
arr - 5
arr * 5
arr / 5
arr[0, :] # first column
arr[:, 0] # first row