I am new to Python and I am very confused with all these data type such as Series, Array, List etc. Probably this is a very open ended question. I am hoping to get a feel on the general practice when coding in python for data analysis.
Lots of readings have been suggesting that numpy and pandas are the two modules I needed for data analysis. However, I find it hard and weird as they are operating/generating data in two different data types, i.e. Series and Array. Is it normal/natural that one needs to convert either one of the data type to another one before any kind of data manipulation? Would like you know what would you do? Many thanks.
for example:
import pandas as pd
import numpy as np
# create some data
df = pd.DataFrame(np.random.randn(10, 3), columns=['a', 'b', 'c'])
x = np.random.randn(10, 1)
# data manipulation
A = df['a']
# Question 1:
# If I want to perform a element by element addition between x and A
# How should I do? Simple x + A doesn't work but it seems strange to
# me that if I have to convert the data type everytime
# Question 2:
# I'd like to combine to two columns together
# concatenate or hstack both don't work
numpy.arraysorpd.Seriesandpd.Dataframes?